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,066 through 1,080 (of 1,097 total)
Problem:
How to display linked posts based on shared taxonomy
Solution:
Create a View that will be added to a page that shows the first post type (either singularly or in a loop) which displays the second post type. This view needs a taxonomy filter adding to "Select posts with taxonomy: ... the same as the current post in the loop" which specifies the shared taxonomy.
Problem:
Check if the parent post has specific taxonomy terms.
For example:
1) Ydelser (services in danish)
2) Personer (staff in danish)
3) Relationer (relations in danish, a intermediary as guided in your documentation).
Staff has a taxonomy named "Positions", which has the terms "Jurys" & "Secretaries".
I want only "Secretaries" displayed from the Staff, in the service, not all staff.
Solution:
1) Create a content template for display the information of parent "medarbejdere" post, for example the content template "medarbejdere-info", with below codes:
Please replace the "Secretaries" with term's name and replace "positions" with your custom taxonomy slug.
2) Display the parent information with the content shortcode:
Problem:
The client wanted to create a view using both a taxonomy filter and a post filter for hierarchical posts that have no parent.
Solution:
In the view add 2 query filters, one for the taxonomy term, and another one that filters by post parent for "posts with no parent (return top-level elements)"
Problem:
I want to create different Variations for a given Post, just as WooCommerce Variable Products.
Solution:
You can use different approaches.
Given that a Views Parametric Search will return your data (which are Post Types) those will be searchable by this Posts Types Meta Data (Fields, taxonomies, etc)
The meta Data (fields, taxonomies, etc) will determine the variations of our posts.
Since above is the case, you need a Post for each "different variation".
You could also set up a Parent / Child Relation with Types, and as example, create a Parent Post Type "Homes", and a Child Post Type "Features"
This Child Post Type would hold all Fields that can change (the properties of your homes)
Then, you create one Parent Post Type (HOME) each "house" you have, and add as many Child Posts (features) to it, as you need.
But it will basically be the same as creating many Home Posts, as you still would need many Child Posts for every variant of a home
Problem:
How can I display a Post, that is Grandchild of a given Post.
Grandchild means, it's a Child of a Child of a Parent Post.
Solution:
You just need to create at least 2 Views
1. First View you query by
Select posts that are a children of the current post in the loop
2. Second View you query either by
Select posts that are a children of the current post in the loop.
or by
Select posts that are children of the Post where this View is shown.
(If you want to use this on a single Post)
3. Insert the First View to the Second View's Loop
4. Insert the second View to the Parent Post, or to a 3rd view where you query those parent posts.
The end result is:
- View > Lists certain Posts not child of any
-- View > Lists posts child to the post in the Loop of the above View
--- View > Lists posts child of the post in the Loop of the above View