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 - 601 through 615 (of 659 total)
Problem:
How to output a comma-separated list using a View but not having a trailing comma after the last item.
Solution:
You need to output the content followed by a comma for most of the loop iterations except the last one, where you would output the content only.
You output different content for different iterations using the wpv-item shortcode.
This is handled automatically if you use the Loop Wizard and choose the comma-separated list output option.
Problem:
Using conditional shortcodes, how could you test a child post to determine whether its parent post was of one post type or another?
Solution:
In the context of a child post you can refer to fields of the parent by adding the item attribute to shortcodes, e.g.
[wpv-post-title item="@relationship-slug.parent"]
So you can add a conditional shortcode that tests whether the parent title from a particular relationship is empty or not; that will tell you whether the parent is of a particular post type.
Problem:
Display repeatable group fields in related post
Solution:
We have Doc where you will find step by step tutorial that will help you to display repeating field groups. Actually, you need a view to display the repeating field group fields:
Problem: I am unable to add nested repeatable field groups in the custom field group editor. When I try to save, the nested RFG and fields are not saved as expected.
Solution: Increase available memory and max_input_vars.
Problem: I would like to display information from two different grandparent post types on a parent post. I would also like to create a Form that creates child posts, and insert a link to that Form on the parent post so that the parent is automatically selected.
Solution: Create a View of Requirement CPTs. In the Loop, you can insert the post title shortcode to display the related Company name. Click "Fields and Views", then "Post title", and you will be shown a popup. Click the "Post Selection" tab, then choose "A post related to the current post, set by a Types relationship". Next, select the Company post in your Company > Requirement post relationship.
Create the new Submission Post Form and insert it in a custom Page. Then return to the View of Requirements editor and use the Toolset Forms button above the Loop Editor to insert a "Create Child Post Link". Select the Page containing the Submission Post Form, and a link will be automatically inserted for you.
When Users click the link, they will be directed to the Page containing the new Submission Form. If you want to hide the parent select field in the Form, you can use CSS in the Form editor.
<div style="display:none;">
[cred_field field="@relationship-slug.parent" class="form-control" output="bootstrap" select_text="--- not set ---"]
</div>