Skip Navigation

[Resolved] How can I display the children posts of post type in one of other child post typ

This support ticket is created 5 years, 2 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

Author
Posts
#1388595

Tell us what you are trying to do?
Hi,
I have post type called tenant that is parent of two post types (contacts and rentals). I want to display all the contacts of the tenant for current rental in rental content template.

#1388689

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

So, You have post types:
- tenant
-- contacts
-- rentals

I want to display all the contacts of the tenant for current rental in rental content template.
==>
so do you mean that you want to display the contacts on single rental page where we need to find the tenant belongs to rentals and then based on that related tenant we need to find the related contacts belongs to those tenant?

#1390419

Yes exactly

#1391167

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

This will need a nested view.

Where:
- create a view X - that query the tenant and add the post relationship filter from the query filter section to filter by current post.
- create another view Y - that query the contact and add post-relationship filter from query filter section to filter this by current post in loop and format the loop editor section as required.
- Add the view Y to X view's loop editor section.

More info:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/#1-creating-a-view-that-lists-the-children-of-the-parent-post
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items
=> https://toolset.com/documentation/user-guides/using-a-child-view-in-a-taxonomy-view-layout/