Views is a WordPress plugin that lets you display post relationships.
In our user guides, you can find more information on how to display child posts, related posts, brother pages, fields of parents and fields of grandparents.
When you ask for help or report issues, make sure to tell us the type of the relationship you are trying to build and the structure of your data.
Viewing 15 topics - 1,051 through 1,065 (of 1,097 total)
Problem:
How to display fields from a parent post when showing the child post.
Solution:
Manually edit the shortcodes being used to display content from the parent post to add id="$parent-slug", i.e. the slug of the parent custom post type, which tells Views to use the parent rather than current post as the source.
Problem:
So now I have:
Director CPT as parent of Movie CPT
Cast CPT as parent of Actor CPT and Movie CPT
Production Group as parent of Producer CPT and Movie CPT
Is it possible to search for a Child (Movie) by associated relationships (Actors) of it's parent CPT (Cast)? And if so, how so?
If not, then do you think it's possible to implement some naming methodology for the intermediary CPT that includes the actors that would allow for this? Solution:
A1) Cast CPT as parent of Actor CPT and Movie CPT
To setup many-to-many relationships between post types "Actor" and "Movie", you will need to setup "Cast" as child post type of "Actor" and "Movie".
See our document:
Creating and Displaying Many-to-Many Post Relationships https://toolset.com/documentation/user-guides/many-to-many-post-relationship/
Same as above, I suggest you setup Many-to-Many relationships between below post types:
Movies and Directors
Movies and Producers
A2) Is it possible to search for a Child (Movie) by associated relationships (Actors) of it's parent CPT (Cast)? And if so, how so?
Yes, it is possible to search for a Child (Movie) by associated relationships (Actors), see above document:
Displaying Many-to-Many Relationships Using Views https://toolset.com/documentation/user-guides/many-to-many-post-relationship/#4 Relevant Documentation:
Problem:
In the nested views, the child view does not display any post.
Solution:
Please check the child view, make sure it is using the post relationship filter:
Select posts that are a children of the current post in the loop