Views is a WordPress plugin that lets you easily design the display of single pages using content templates. You can also include any field belonging to the content in your templates, without writing PHP code.
When you ask for help or report issues, make sure to tell us what you have created so far and what you want to achieve.
Viewing 15 topics - 2,191 through 2,205 (of 2,239 total)
Problem: I am using a one-to-many relationship where Products are children and Styles are parents. I would like to create a View of Products to display on the Style post. This View should only show children of the Style post. In that list of Products I would like to display an Add to Cart button.
Solution: Create a View of Products, filtered by post relationship, where the parent post is set by the current page. In the Loop, include the wpv-woo-buy-or-select shortcode to generate the Add to Cart button.
Problem:
The client is producing a list of content that he wants to appear in modals and has the problem that all of the links to open a modal open the same first modal content.
Solution:
The modals implementation requires linking to modal elements by their id, and the loop output section of the View uses "static" markup for the id, so the markup for each modal has the same id. You need to generate unique ids using the wpv-post-id shortcode (for posts) or wpv-taxonomy-id shortcode (for taxonomy terms), e.g.
Problem: I would like to use a custom field image as the background of a Divi specialty section.
Solution: The best way to use a custom field as a background image with the Divi builder is to use a text module and add inline CSS to a wrapper element. It is not possible to place a Toolset shortcode in a Divi module's styles editor, because Divi does not support any shortcodes here.
Problem:
The output of an existing View now includes wrapper divs with classes of .et-boc and .et_builder_inner_content which messes with the current style rules.
Solution:
Divi introduced this change—which even affects Views where the template is *not* designed with Divi—in version 3.10.1.
After many user complaints about side-effects it is expected to be removed in subsequent Divi versions.
Problem: On the single post template, I would like the next and previous links to point to the next or previous post in the same category. Several posts will have the same publish date and time.
Solution: Use a custom date field to store the post creation date and time whenever a post is created.
There is a small number of cases where the relationship (deliberately) does not exist. I would like, in these cases, to provide generic text to note this.
Solution:
If the relationship (deliberately) does not exist, the shortcode [wpv-post-id id="$ecotypes-main-theme"] will output the current post ID, so you can use it to compare with shortcode [wpv-post-id], for example:
[wpv-conditional if="( '[wpv-post-id id="$ecotypes-main-theme"]' eq '[wpv-post-id]' )"]
relationship (deliberately) does not exist.
[/wpv-conditional]
Problem: I want to design an Archive layout which will apply to all pages. So on the main Member Profiles archive page, a user can click on one of the taxonomy terms and see the same archive layout for all members who have that taxonomy term selected. And finally, once it is designed, I want to use a shortcode to place the archive view in my pages.
Solution:
- WordPress automatically generates archives for custom post types and for custom taxonomy terms. You can customize the archive pages using Toolset's WordPress Archives feature.
- A Toolset WordPress Archive can be applied to a custom post type archive, and also to a taxonomy archive. So yes, you can create one WordPress Archive and use it for both.
- You can insert taxonomy term links in each post in the archive using the wpv-post-taxonomy shortcode. In the Loop Editor section, you will have the ability to insert the shortcode in the wpv-loop tags. When a User clicks one of these terms they will be redirected to the corresponding term archive.
- WordPress Archives cannot be inserted with a shortcode, because they are designed to be displayed only on archive pages. Since these are generated automatically by WordPress, no shortcode is provided. If you want to create similar lists of posts and display them on other parts of your site besides the archive pages, you can create filtered Views that return the same results. You can copy the code from the Loop of your WordPress Archive and apply it to the Loop of your filtered View.