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.
The customer was attempting to use a shortcode to display a custom field (CPF) conditionally within the Divi Theme Builder’s tab module. While the shortcode functioned correctly outside the Theme Builder, it only displayed the raw shortcode within the builder, failing to render the expected content. The issue appeared to stem from Divi’s Theme Builder potentially overwriting post variables required by shortcodes.
Solution:
A workaround was suggested due to the limitations in Divi’s handling of shortcodes within the Theme Builder. A custom PHP function was created and added to the theme's functions.php file to handle the conditional logic and output the custom field directly:
function display_reisekosten_func() {
if (get_post_meta(get_the_ID(), 'wpcf-reisekosten-pauschal-individuell', true) == '1') {
return '<h2>Reisekosten</h2>' . do_shortcode('[types field="reisekosten-min-km"][/types]');
}
}
add_shortcode('display_reisekosten', 'display_reisekosten_func');
The shortcode [display_reisekosten] could then be used within a Divi Code Module to render the content conditionally. While not a guaranteed solution, this approach provided a viable alternative until Divi resolves the underlying issue.
The customer was working on a Custom Post Type ("Object") that represents artworks on their museum platform. They created specific content templates for different museums to cater to their unique display requirements. However, there was no option in the Custom Post Type Forms for the museum staff to assign the appropriate content template when creating or editing an artwork. The customer wanted to eliminate the need for staff to navigate the wp-admin editing page, which could lead to confusion and errors.
Solution:
We suggested utilizing a generic field in the form to enable the selection of a content template. The customer successfully implemented a dropdown select field, but encountered an issue where the selected option did not display when returning to the form. To resolve this, we provided a custom PHP function that retrieves the current template assigned to the post. The code snippet for the function is as follows:
add_action('cred_save_data', 'my_save_data_action', 10, 2);
function my_save_data_action($post_id, $form_data) {
// Array of form IDs for which the action should be triggered
$form_ids = array(21166, 18806);
// Check if the current form ID is in the list
if (in_array($form_data['id'], $form_ids)) {
if (isset($_POST['select-template'])) {
update_post_meta($post_id, '_views_template', sanitize_text_field($_POST['select-template']));
}
}
}
After further testing, we recommended that for museum editors, the solution could be simplified by hardcoding the content template ID to ensure the correct template is always assigned. This change allowed for the expected functionality when creating or editing artworks.
The customer wanted to add or delete a funder's name/logo to/from a dropdown list on a page. They were unsure how to achieve this and lacked guidance from the previous developer.
Solution:
We found that the dropdown is hard-coded in the child theme's functions.php file. Adding an image directly into elements of a dropdown is not supported by browsers. We suggested using a library like Select2 or Chosen for advanced customizations that allow images in dropdowns, but this requires significant code customization, which falls outside our support scope. We advised the customer to contact a Toolset contractor for further assistance.
The customer reported an issue where the navigation on a page wasn't functioning correctly when the user was not logged in. The problem was traced to a lock icon appearing on the 'rating' field when users were not logged in. This lock was initially thought to be added via Toolset settings, but it was later discovered to be caused by a third-party plugin called "Restrict Content" by StellarWP.
Solution:
After identifying that the lock icons were being added by the "Restrict Content" plugin, we suggested temporarily disabling the plugin to confirm that it was the cause of the issue. The customer confirmed that the issue disappeared when the plugin was disabled. Since the plugin caused the issue, we recommended contacting its support team for further assistance. As a workaround, we provided a custom CSS code snippet to hide the lock icons from the outside of the table, allowing the page to function correctly even with the plugin enabled:
The customer wanted to move the "Next" pagination button to the right side of the page on their "Homepage - Testimonial Slider."
Solution:
We provided a custom CSS code to align the "Next" button to the right side. The code was added to the theme's customizer, ensuring the "Next" button appears on the right even on the first slider.
The customer created a content template and set up custom fields to display within this template. However, the content template is not being displayed on the front end as expected.
Solution:
The issue likely stems from the theme's compatibility. The customer's theme may be a block-based theme (such as Twenty Twenty-Four), which does not utilize PHP templates. As a result, Toolset content templates cannot override the theme's default display settings. It was suggested to switch to a traditional PHP-based theme to ensure that Toolset content templates are displayed correctly on the front end.
The customer reported an issue where a filter they created worked fine, but the sorting by "vintage" on the results page was not functioning properly. The issue was observed after clicking on the sorting option by "vintage."
Solution:
We identified that the issue was related to the "vintage_post" field, which was created and managed by ACF (Advanced Custom Fields). The sorting issue did not occur when using a Toolset custom field. As a workaround, we advised the customer to manage the "vintage_post" field with Toolset by following these steps:
- Go to Toolset > Custom Fields and click on the "Post Field Control" button.
- Search for the "vintage_post" field and click on "Manage with Types."
- Edit the Toolset View "ADVANCE FILTER" and change the column field from
This workaround allowed the sorting to function correctly using the ACF field within the Toolset View. The customer confirmed that the solution worked perfectly on the staging site.
The customer was unable to save their content template and encountered JavaScript errors when updating the Kadence Pro plugin, which prevented access to the content templates. The customer reported issues that seemed to stem from changes in WordPress 6.6, affecting Toolset dynamic sources.
Solution:
We escalated the issue to our second-tier support, who identified that the problem was due to changes in WordPress 6.6 affecting Toolset dynamic sources and resulting in JavaScript errors. We applied a workaround on the customer’s development site, which involved several steps:
- Deactivated Toolset Blocks.
- Registered a temporary custom post type for viewing templates.
- Made a minor edit to the affected template titles to enable the Update button.
- Saved the templates and then unregistered the custom post type.
- Reactivated Toolset Blocks and attempted to edit the repaired templates.
After applying these steps, the customer was able to access and edit the content templates successfully. A video was provided to demonstrate the process.
The customer confirmed that the workaround worked, resolving the issues with saving and accessing their content templates.
The customer inquired whether it is possible to create content templates using Elementor.
Solution:
We confirmed that Toolset is compatible with Elementor and that it is indeed possible to create content templates using Elementor. We provided a tutorial link with a step-by-step guide, including screenshots, to assist the customer in setting it up.
The customer reports that the "Added to Cart" message is not displaying correctly on their product page, even though a previous similar issue had been resolved. The initial troubleshooting step of toggling the AJAX add to cart buttons did not resolve the issue.
Solution:
I identified that the issue was caused by a specific line of code in the template that interfered with the wpv-add-to-cart-message shortcode:
The content on the blog archive page is not fully translated. A slider added to the archive template appears correctly in the default language (Spanish), but in other languages (e.g., English), a different slider from another plugin is shown. The archive pages sometimes show French as the default language instead of Spanish, indicating a potential conflict between WPML and Toolset.
Solution:
The customer discovered that the plugin "Post Types Order" by Nsp Code was causing the issue. This plugin created different template versions for each language and changed the default language of existing templates.
Deactivating and reactivating plugins one by one helped identify the culprit.
The customer removed the "Post Types Order" plugin, which resolved the issue.
The customer wants to display a custom field (Distributer) on a custom post page, but the field only shows "Booktopia/Amazon" regardless of the actual content, even if the field is blank. Other custom fields are working correctly.
Solution:
I identified that the issue was with the Content Template where the value 'Booktopia/Amazon' was added as plain text instead of a dynamic field.
I replaced the static text with the correct shortcode [types field='distributor'][/types] to dynamically display the field's content.
After the change, the proper distributor value is being displayed correctly on the custom post pages.
Problem:
The customer wants to make an entire box clickable, specifically the contents of the Content Template, on a WordPress archive. They tried wrapping the entire