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 - 1,786 through 1,800 (of 2,084 total)
Problem:
I am seeing JS errors when using Types since it's been updated, in specific browsers only.
The errors are like "Uncaught ReferenceError: Unable to process binding "spinnerActive: function(){return isAnySectionUpdating }"
Solution:
This can be due to cached versions of JS files that where not flushed by the Toolset Plugins updates.
Helpful it is to clear the browser cache in such situations.
Problem: I would like to display a JavaScript widget on the single post page for my custom post type. Each post will have a unique script tag, so I would like to store that in a custom field. I have created a post template with Elementor for this custom post type, and I would like to inject the script from the custom field into the single post template.
Solution: You can use a custom shortcode to generate the script tag, then place that custom shortcode in your Elementor template.
function ts_show_widget( $atts ) {
global $post;
$field_slug = 'unique-string'; // replace this with the slug of your custom field
$atts = shortcode_atts([
'postid' => isset($post->ID) ? $post->ID : 0
], $atts);
$field = types_render_field($field_slug, array( 'item'=>$atts['postid'], 'output'=>'raw'));
$script = "<script>console.log('Unique string: " . $field . "');</script>"; // update your script here
return $script;
}
add_shortcode( 'ts-show-widget', 'ts_show_widget' );
Problem: If I add media from the Media Library to a Content Template, will that media work in multiple Views, or will I have to upload the media to each View?
Solution: When you insert Media into a Content Template, the system generates an image tag with a hard-coded image URL. As long as that item exists on the server, the image will appear across multiple Views that use the same CT.