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 - 121 through 135 (of 697 total)
Problem: I have two post types in a one-to-many post relationship. Artists are the parents, and Paintings are the children. In the Artists post type, I have a checkbox custom field. I would like to create a View of Artist posts that only shows Artists with related Paintings. I would also like to include any Artist where the checkbox is checked.
Solution: To accomplish this without custom code, you need 3 Views:
- #1: View of Artists, filtered by checkbox field. Use the legacy Views editor and choose the output type "List with separators". Output the Artists IDs as a comma-separated list.
- #2: View of Artists, filtered by post ID using a shortcode attribute "ids". Design the output as you would like to see on the front-end of the site.
- #3: View of Paintings with no filters. Use the legacy Views editor and choose the output type "List with separators". In the loop, include the post ID of the parent Artist post.
Insert View #2 in your template or page using a shortcode. In the ids attribute, place View #1 and View #3.