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 - 691 through 705 (of 731 total)
Problem: I would like to be able to get the ids of both related posts in a M2M relationship using the PHP Post Relationships API, when the intermediary post ID is known.
Solution: Use the toolset_get_related_posts API to retrieve related post information using the intermediary ID like this:
There is a one-to-many relationship between Author and Essay; Author is the parent post of Essay. The Author CPT has a field named Person Type. Person Type has a couple possible values: student, faculty, and alumni.
I am trying to use a View to display a list of Essay posts whose Authors are alumni.Is this possible?
Solution:
Unfortunately, there isn't such a built-in feature within Views plugin, Views is using WordPress class WP_Query to query the posts, if you are querying "Essay" posts, Views can only filter the view by custom fields of "Essay" posts, it can not filter by fields of other post type, this is a limitation of WordPress.
Currently, I suggest you use [wpv-conditional] shortcode to check field "Person Type" value of related "Author" post, if the value is "alumni", then display the "Essay" post.