Skip Navigation

[Resolved] Display posts according their child

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.

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

Problem:
I have a Parent and Child Post Type.
In the child Post Type I want to display all related Parent posts.
In Views Query Options there is an option to display Posts that belong to the parent, but not the opposite, Posts that "parent" a child.
What can I do?

Solution:
This is not possible.
With Views you can query any Child post of a given parent.
But you cannot display a parent according of the Current Child Post.

What you can do instead is query the Child Post and call it's parent post fields:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

This can also be done in a Content Template of course.

This support ticket is created 7 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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 2 replies, has 2 voices.

Last updated by kirillS-3 7 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#523791

I am trying to:

I have Post Type Person
And I have Post Type PersonInPost
so, Person is a Parent for PersonInPost
I want to show some custom designed view of Person within PersonInPost.
For this reason I create a view "PersonThmb" and what to show it inside PersonInPost view loop.
But I find no way how to set post ID in PersonThmb view to Person Post as Parent of current PersonInPost.

So, it is work for one field as

[wpv-post-url id="$person"] - it show post url from parent post

but this way doesn't work:

[wpv-view name="personthmb1" id="$person"] - this just write an error that there is no view like this ( [wpv-view name="personthmb1"] works, but with wrong result)

So, is it possible to filter view as Parent Post for particular post, but not Child Post for particular post?

#523897

This is not possible.
With Views you can query any Child post of a given parent.
But you cannot display a parent according of the Current Child Post.

What you can do instead is query the Child Post and call it's parent post fields:
https://toolset.com/documentation/user-guides/displaying-fields-of-parent-pages/

This can also be done in a Content Template of course.

#523991

Oh, ok... It could be great feature - to use Parent Views for child templates.

The forum ‘Types Community Support’ is closed to new topics and replies.