With the Views plugin you can create different Views elements to display all your custom types and content on the front-end, without coding. You can also create powerful parametric searches and add pagination to your content lists.
When you ask for help or report issues, make sure to tell us the options of your View.
Viewing 15 topics - 7,681 through 7,695 (of 7,713 total)
Problem:
On a post archive or a view that lists posts of custom post type, such that:
-Posts Can (but do not have to be) children of the other post type.
-Posts with parents should have a link to the parent, posts without parents should not have such link.
The issue: if no parent is assigned, a random link to Parent CPT is displayed.
Solution:
Use wpv-if to evaluate if the CPT has a parent (Check the documentation).
If it returns true, the link will be displayed, on false, it won't.
Example:
-Problem:
--I need to check if each post int the loop has a parent post of type "Teams".Teams custom post slug is "teams"
-Solution:
--Use the "wpv-if" to check if the post has parent(s)
--Use the "_wpcf_belongs_{parent-slug}_id" to get the teams that the post belongs to them and assign it to a variable in the same condition like this (teams="_wpcf_belongs_teams_id").
--Check if the list of teams is empty using the "empty" function like this "empty($teams)".