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 - 571 through 585 (of 654 total)
Problem: I need to show all the workers belong a Job (parent) in a list in the parent content template.
Solution:
One way to do this is to nest two Views together.
1. Create a View of Jobparts, filtered by Post Relationship where the parent Job is set by the current post
2. In the Loop editor of that View, click "Loop Wizard" to design an unformatted loop. For now, insert the Post Title shortcode.
3. Place this View on the single Job post page, and you should see a jumbled up list of Jobparts. That's fine for now.
4. Create a View of Workers, filtered by Post Relationship, where the parent Jobpart is set by the current post in the Loop
5. In the Loop Output editor, build your list of Workers however you would like to format them
6. Edit the View of Jobparts and delete the wpv-post-title shortcode in the Loop Editor. Replace it with the shortcode to display the View of Workers.
Problem: I have a View that shows Events as a list, and also on a map. If the Event is "private", I do not want to show it on the map but I want it to appear in the results.
Solution: Use a checkbox field or a radio field to set the public / private status of each item. Use conditional HTML to show or not show the map marker for each result.
Problem: I have a View of terms in a custom taxonomy. Nested in the Loop of that View I have placed another View of posts, filtered by taxonomy term. It's working as expected but I would like to hide the taxonomy term from the outer loop if no posts are found in the inner loop.
Solution: Move the taxonomy term shortcode from the Loop of the term View into the wpv-items-found section of the post View. Do not place it in the Loop of the post View, since it may be repeated there.
Problem: I have a one-to-many relationship between Organizzate (parent) and Consuntivi (child). I have several custom fields on the Organizzate post, including a repeatable field group (RFG). On the Consuntivi post Content Template, I would like to display the custom fields from the parent Organizzate post, as well as a View of RFG from the parent Organizzate post.
Solution: To display custom fields of the parent post, you should use the Types field syntax like this:
To display a View of RFG from the parent post, set up the View's post relationship filter to respond to a shortcode attribute "wpvrelatedto". Then use the wpv-post-id shortcode to set the value of that shortcode attribute, like this:
Problem: I have 3 post types related in one-to-many relationships like grandparent > parent > child. I can show a list of parent posts on the grandparent post, but I would like to show a list of child posts for each of the parent posts. How can I do it with one View?
Solution: You must use two nested Views. In the nested View, add post relationship filter where the parent is set by the current post in the loop.