Skip Navigation

[Resolved] Show related Child Posts on current post

This thread is resolved. Here is a description of the problem and solution.

Problem:
How can I display Childs of a Post, when viewiing that parent Post?

Solution:
You create a View that displays Posts, and set the Query Filter to:

Select posts that are children of the Post where this View is shown.

Then you insert that View to your Parent Post.

Relevant Documentation:
https://toolset.com/documentation/user-guides/displaying-related-child-posts/

This support ticket is created 7 years, 11 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 5 replies, has 2 voices.

Last updated by jayK-3 7 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#395796

Hello,

I have 4 custom post types:
parent1, parent2, child1, and child2. Both child1 and child2 have both parent1 and parent2 as parents.

I created a view of child2 that displays fields of both parents. Within this child2 view, I want to insert a view of child1... but, this view of child1 would only display fields specific to parent2.

Is this possible? I already tried the tutorial for displaying brother items, but it is not working.

Thank you for your help!

#396054

In your Child1 View you would simply just call parent Fields of Parent2.

It will then query the Child1 Posts and display the Parent2 Fields (called by adding the "id=$parent2" in the respective Fields)
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

The Brother Pages approach is for something different, it's used in Hierarchal Post Types, such as native WordPress pages, where one post of the same type can be Parent of a Post in the same type.

Please let me know if you need further infos about this.

Thank you for your patience.

#396477

I'm sorry, I explained that wrong...

I want to insert a view of child2 within child1, but specify that this view of child2 be children of parent2.

#396485
screenshot2.png

Is there a way to use filter in the attached screenshot to specify the parent? Using the filter "parent is current post in loop" isn't working because the loop is a view of child1.

Thanks!

#396784

You can use only the Options presented in that GUI.

Your case would actually be coverable with the ShortCode argument.
But you will not be able to add more then One Parent Post ID there
(I actually requested a feature to add more then one Post Parent in this argument, it's in our ToDo List)

You could also create a 4th View, query parent2, insert a View that returns Child2, and insert the View that queries Parent2 in your actually view where you display Child1

That will work, as the parent is defined already.

Thanks

#396924

Thank you

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.