Skip Navigation

[Resolved] How do I show all of the "Speakers" as I loop through each podcast?

This support ticket is created 2 years, 8 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.

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)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 2 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#2312565
Screen Shot 2022-03-09 at 12.06.29 PM.png

Hello!

Regarding this page: hidden link

I have POSTS (podcasts)
And I have SPEAKER which is a custom post type, with a many-to-many relationship with POSTS.

I have a working view that shows all my POSTS, and which can be filtered by related SPEAKER. Works great.

But how do I display a list of the related speakers as I loop through each POST? I've been playing with the "Fields and Views" button for half an hour and I can't figure it out. See attached. I'm hoping there's a shortcode for listing out the related speakers (instead of having to nest a second VIEW within this view...)

Thanks!

#2312833

Hi,

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

Your understanding is correct and whenever you need to show multiple related posts, a view with a relationship filter will be needed.

In this case, you'll create a new post view to show the "SPEAKERS" posts and in the "Query Filter" section, you'll include a relationship filter to show only the results related to the current "POST" in the parent view's loop.

Once the view is ready, you can place its shortcode, in the parent view's loop, where you'd like to show the related speakers.

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar

#2313577

Interesting, thank you! So I understand that I will need to "nest" one view inside of the other view.

Will this have a significant performance impact? The reason I ask is because the view that shows my podcasts uses an infinite scrolling method to load new results, and it's already a little slow for each refresh.

#2313975

Thanks for writing back.

Nesting of view will have some performance impact, because, the child view's query will be running for each result item in the parent view.

To improve the performance, you can keep the result per page number in the parent view to a lower value (for example between 5-10), and in the infinite scroll settings, set only 1 page for pre-loading.
( example screenshot: hidden link )