[Resolved] Display parent – other relationship – child – field
This support ticket is created 6 years 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.
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.
I thought about this but there isn't an easy way to do this and would require some custom code to achieve.
Since the field in in a completely different CPT and the only relationship between then is the Parent. Then in order to target that exact post that you ant you will need to know its ID.
Now this is more complex if there are many posts of Post Type A with the same parent because we simply can query based on the parent ID because you will return a number of posts from A with the same parent.
I tried it.
I create a view (esemeny-filmblokkhoz slug) for list "Post Type A" with query filter.
Put this view to "Template for Filmek" with your shortcode.
The result: list all of "Post Type A".
I want: list all of "Post Type A" with the similar parent (filmblokk slug)!
I tried altarnative codes:
[wpv-view name='esemeny-filmblokkhoz' wpvchildof='[wpv-post-id item="@filmblokk-film.parent"]']
[wpv-view name='esemeny-filmblokkhoz' wpvchildof='[wpv-post-id item="@filmblokk-esemeny.parent"]']
[wpv-view name='esemeny-filmblokkhoz' wpvchildof='[wpv-post-id item="anything"]']
{!{wpv-view name='esemeny-filmblokkhoz' wpvchildof='{!{wpv-post-id item='@filmblokk.parent'}!}'}!}
The result: list all of "Post Type A" also...
Query Filter in view:
Filter by post relationship or repeatable fields group owner
- Select items "in the Filmek Esemenyek relationship" as related items of...
- The post with ID set by the shortcode attribute "wpvrelatedto"