Problem:
How to display a field from a grandparent post on a grandchild post?
Solution:
The documentation describes displaying grandparent fields in a View, but you may want to display then directly in the template for grandchild posts.
The basic steps are
- create a Content Template (not assigned to any post type) to hold the fields of the grandparent you want to display.
- imagine that the starting point for *this* template is the parent post. Use the Fields and Views button to insert the required fields, and the Post selection tab to specify that the source is the parent post from the "grandparent-parent" relationship (which, if this is the parent, will be the grandparent).
- now edit the template for the grandchild posts. Insert the Content Template you just made (again, with the Fields and Views button), and use the Post selection tab to specify that the source is the parent of the current post from the "parent-grandchild" relationship.
So, starting from our grandchild post, we insert a Content Template where we specify that the source is the parent post, so that the template "thinks" its context is the parent. So when the fields inside are told to display fields from the parent, it is the parent of the parent.
Relevant Documentation:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-fields-of-grandparents/
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | 7:00 – 14:00 | - |
- | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | 15:00 – 16:00 | - |
Supporter timezone: Europe/London (GMT+00:00)
This topic contains 2 replies, has 2 voices.
Last updated by 6 years, 4 months ago.
Assisted by: Nigel.