Skip Navigation

[Resolved] displaying related posts in a many-to-many-relationship

This support ticket is created 4 years, 4 months ago. 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.

This topic contains 2 replies, has 2 voices.

Last updated by ericaG 4 years, 4 months ago.

Author
Posts
#1801787

I have a post type "Podcast" with a many-to-many relationship to a post type "Guest." I have a view that should display the name(s) of all podcast guests using

[wpv-post-title item="@podcast-guest.child"]

However this will only displays one guest, not multiple (if there is more than one guest).

How can I output ALL guests and specify which separator to use? E.g., | , - etc.

#1802629

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

When you want to display the many part of a relationship (one-to-many or many-to-many) because there can be multiple results you must use a View. You can only use the item attribute to specify a related post as the source for the one part of a relationship (e.g. the parent of some child).

So if your starting point is a podcast then create a View to display guests with a relationship Query Filter to set the parent according to the current post in the loop (if inserting into a View of podcasts) or the current page (if inserting into a template for single podcasts).

#1803439

My issue is resolved now. Thank you!