Skip Navigation

[Resolved] View doesn't show up fields from parent post

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.

Our next available supporter will start replying to tickets in about 6.98 hours from now. Thank you for your understanding.

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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 2 years ago.

Assisted by: Luo Yang.

Author
Posts
#2490885
2022-11-07.jpg

I have 3 post types:
“A”: Phòng (Room)
“B”: Lưu trú (Resort)
“C”: Quảng cáo (Asvertising)
A is in one-to-many with C
B is in one-to-many with A, C

*Tell us what you are trying to do?
I’m creating a view of C at B page. In view search and view output, I put fields from both A and C. But in front-end, the view search only shows choosing fields from C, but not A.

*Is there any documentation that you are following?

*Is there a similar example that we can see?

*What is the link to your site?
hidden link

#2491689

Hello,

I assume you are using one-to-many relationship between post types A and C, in the single C post( Loop of view of C ), you can display the related A post information directly, see our document:
https://toolset.com/course-lesson/displaying-related-posts/#displaying-one-related-item-parent

If you need more assistance for it, please provide your website credentials in below private message box, I can setup a demo for you.

#2491733

Thanks for the details, Toolset Blocks plugin is using WordPress built-in class WP_Query to query posts, you can only filter the results by fields of current post type(C), you can not filter the result by fields of other parent post type(A), so it is expected result, the filter won't be able to work.

#2491737

And you might consider other workaround, for example, you can filter the child C posts by parent A post title, see our document:
https://toolset.com/course-lesson/creating-a-custom-search/#how-to-search-by-post-relationships
section "How to search by post relationships"