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 - 1,036 through 1,050 (of 1,356 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"]