Views is a WordPress plugin that lets you easily display content on your website's front-end in any way you choose.
Views User Guides include detailed documentation for creating lists of content, templates for content and archive page and also explain how to create parametric searches for any content type.
When you ask for help or report issues, make sure to tell us the versions of the Toolset plugins that you have installed and activated.
Viewing 15 topics - 1,456 through 1,470 (of 1,568 total)
Problem: I would like to use shortcode attributes to pass arguments into a View's Query Filter.
Solution: You can configure taxonomy filters and custom field filters to respond to separate shortcode attributes, and add those shortcode attributes to the view shortcode.
Problem: I have created a custom rewrite rule applied to custom taxonomy archives, such that the archive URL includes term slugs from two different taxonomies. I would like to filter a View placed in this archive by these two taxonomy term slugs.
Solution: Create two Query Filters in the View, one for each taxonomy term slug. Set each to respond to a different shortcode attribute. Use custom shortcodes to apply the term slugs from the URL to the corresponding shortcode attributes. Test each component individually by applying hard-coded shortcode attributes in the View shortcode and outputting the results from the custom shortcode separately.
Problem: I have a View of posts in which I have nested another View of taxonomy terms. I would like to filter the View of taxonomy terms so that only those terms applied to the current post in the loop are displayed. If no terms are found associated with the current post in the loop, that post should not be displayed in the results.
Solution: Use the legacy View editor to create and manage nested Views, since this feature is not supported in the Block editor. In the inner nested View, add a taxonomy term Query Filter that filters by the current post. In the Loop Editor, insert the wpv-taxonomy-title shortcode in the loop to display the term title, or use other shortcodes to display other information like the term slug, term archive link, or custom term fields. Include information about the parent post in the wpv-items-found section using shortcodes, but do not place parent post shortcodes inside the wpv-loop tags. Anything in the wpv-loop tags will be repeated for each matching term.
Problem: I have a nested View structure where the outer View shows posts and the inner View shows terms from a hierarchical taxonomy. The nested inner View should be filtered so that only the terms associated with each post in the outer View loop are displayed in the inner View. I would also like to hide any terms that have hierarchical parent terms.
Solution: Use two filters in the nested View. One Query Filter should be based on the term parent, where the term parent is None. This will show only top-level terms from the hierarchy. The other Query Filter should be based on the taxonomy term, and should be set by the current post. This will hide unrelated terms from each nested View.
That would display the nested View and pass the current post ID from View 1 into an attribute attr1, and it would pass the value of custom field some-slug from the current post of View 1 into an attribute attr2.
Then in View #2, you can set various Query Filters to respond to these shortcode attributes, or you can use the wpv-attribute shortcode to access those attributes in the Loop editor:
Parent post ID: [wpv-attribute name="attr1"]<br />
Parent post custom field "some-slug": [wpv-attribute name="attr2"]