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!
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.
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.
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!
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