Hello- I am trying to display posts (A) that are using a child post relationship with hierarchal post (B) using Blocks > Views on an unrelated page. Can you please assist in the correct Content Selection and Query Filters to accomplish this please.
Here is my setup:
Post Type A = Community
Post Type B = City & Neighborhood
Post Type B has hierarchy setup with Parent posts. Example: Parent post = St. Paul (city) and child post = Highland Park (neighborhood).
Instead of creating queries for all child posts (neighborhoods), I'd like to say: display all Communities (A) that are related to City (B) via a Neighborhood (B child).
Thank you!
Screenshots here:
Hello,
I assume we are talking about this case:
1) Two post types:
- City & Neighborhood (hierarchal post type)
- Community
2) One-to-many relationship between "City & Neighborhood" and "Community"
If it is, you can try with nested view:
1) Parent post view:
- Query "City & Neighborhood" posts
- Filter with:
Select posts whose parent is the page where the View is shown.
see my screenshot post-parent-filter.jpg
- In view's loop, display below child post view
2) Child post view:
- Query "Community" posts
- Filter with:
Select posts in a Cities Hoods to Communities relationship that are a related to the current post in the loop.
- In view's loop, display "Community" post information
In the "City" post, display the parent post view
Thank you Luo Yang, this helped me find the correct solution.