Skip Navigation

[Resuelto] Show Related CPT in Archives

This support ticket is created hace 2 años, 8 meses. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Este tema contiene 3 respuestas, tiene 2 mensajes.

Última actualización por duongN-3 hace 2 años, 7 meses.

Asistido por: Waqar.

Autor
Mensajes
#2333863

Tell us what you are trying to do?
I want to show some fields from a Related CPT in an archives page.
Archives page: enlace oculto
This archives page contains 3 different CPTs: Dramas, Movies, and Specials
Each CPT may have a "Related CPT of Subtitle Project"

Example of a Drama CPT with a "Related Subtitle Project":
enlace oculto
Image: enlace oculto
You can see that there's a special callout box for "Available Subtitles"
I'm able to get the fields to show up from the "Related Subtitle Project" on the "Drama CPT"

Is there any documentation that you are following?
No.

Is there a similar example that we can see?
I'm trying to add the same fields from the "Related Subtitle Project" in the Archives.

I'm using the below code:
Subtitle Status: [types field='overall-status' item="@related-subtitle-project.child"][/types]
[wpv-conditional if="( '[types field='overall-status' output='raw' item="@related-subtitle-project.child"][/types]' eq 'ongoing' ) OR ( '[types field='overall-status' output='raw' item="@related-subtitle-project.child"][/types]' eq 'dropped' )"]
([types field='episode-status' item="@related-subtitle-project.child"][/types])
[/wpv-conditional] by [wpv-post-link item="@related-subtitle-project.child"]

I want it to display this:
Subtitle Status: Status of Subtitle Project by Subtitle Provider's name
Subtitle Status: Announced (linked to Subtitle Project) by amrayu (linked to Subtitle Provider page)

Parts of the site are blocked by Guests. If you need Admin access, please let me know.

What is the link to your site?
enlace oculto

#2334091

Hi,

Thank you for contacting us and I'd be happy to assist.

To suggest the best way to achieve this, I'll need to see how these archives and the single post pages are set up, in the admin area.

Can you please share temporary admin login details in reply to this message?

Note: Your next reply will be private and it is recommended to make a complete backup copy, before sharing the access details.

regards,
Waqar

#2335075

Thank you for sharing these details.

As "Subtitle Projects" post type has a many-to-many post relationship with the post types "Drama", "Movies" etc, you'll need a post view to show the information from the related subtitle post.

On the single drama post page, the website is using a view "Subtitle Projects for Dramas Movies Specials" to show the related subtitles information. You can use the same view in the loop of the archive "Drama Archive" and it will display the related subtitle post information.

If you need to show subtitle information in a different format or with different/selective fields in the archive, you can create a duplicate of the view "Subtitle Projects for Dramas Movies Specials" and use that instead.

#2335707

My issue is resolved now. Thank you!