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 - 2,221 through 2,235 (of 3,151 total)
Problem:
The user has a select field with dynamic option values. The options of the field are generated using Toolset Types filter wpt_field_options. The generated options are the months of the last two years.
Inside a view, the field is not displayed anymore.
Solution:
It turns out that the values that are not displayed are not included in the values generated by the wpt_field_options filter. Toolset returns an empty value.
The solution is to use a custom shortcode that will return the row value from the database.
// The shortcode needs to be added in Toolset->Settings->Custom Code.
add_shortcode('meta', 'meta_fun');
function meta_fun($atts){
global $post;
$atts = shortcode_atts(array(
'field' => NULL,
), $atts);
extract($atts);
if( NULL === $field ) return;
// return "Voila";
return get_post_meta($post->ID, $field, true);
}
// How to use it inside the view
[meta field="wpcf-production-year-month"]
Problem: I have a nested repeatable field group (RFG) structure inside a custom post type. I also have another child post type of that main custom post type. On the child post template, I would like to display information from the RFGs. I can display information from the main RFG, but not the nested RFGs.
Solution: Check to be sure the correct RFG type is selected in the View's Content Selection panel.
Problem: I would like to display a list of posts organized by taxonomy term. I understand I would need to first create a View of taxonomy terms, then create a nested View of posts filtered by taxonomy term. However, I cannot find my taxonomy View in the list of Views available to display with a Views block, and when I place the View of posts it does not work as expected.
Solution: You must place a taxonomy View in the block editor using a View shortcode, since taxonomy Views are not supported in the Views block. The post View must then be placed inside the loop of the taxonomy View using another View shortcode.