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 - 106 through 120 (of 710 total)
Problem:
Count number of entries in repeating field group return 0
Solution:
To get total count based on repeating field group items, you will require to use the post relationship API function toolset_get_related_posts().
Problem: I have two custom post types, Recipes and Ingredients, in a many-to-many (M2M) post relationship. In the intermediary post type, there is a custom field representing the quantity of each Ingredient in a specific Recipe. On the Recipe post template, I want to display a list of related Ingredients, the quantities of each, and I want to sort the Ingredients using a custom sort order I specify in wp-admin.
Solution: In the Recipe post, add related Ingredients in the Recipe post's relationships panel, and set the quantity and sort order for each Ingredient. In the Recipe post template, create a View of the intermediary post type. You must query the intermediary post type in order to specify your own custom sort order, which must be managed in a custom number field in the intermediary post type. Use the Query Filter to filter by post relationship, where the intermediary post type is related to the post being displayed. Use the Ordering panel to order by the custom order field in the intermediary post type. Display information about the related Ingredient post and the corresponding quantity in the loop of the View.