I am trying to:
Create a search form that uses ajax filtering and show information such as the post/page title, featured image, excert/begginging of page content and post type.
Link to a page where the issue can be seen: hidden link
I expected to see:
When page first loads all content is shown as expected. However if you use the filter options and select pages, any page that has been built using WP Bakery shows WP Bakery shortcode inside of the excerpt. This only happens when using the ajax filtering and if I turn the ajax filtering off and use manual page refresh instead it all works as aspected. However the ajax filtering is a vital part of the usability of our search form. The same problem occurs when using any ajax pagination and a WP Backery page is involved.
This is actually a known issue with Toolset and visual composer. The problem is that Visual Composer doesn't work well with ajax reloads.
You can try this solution below by adding it to your functions.php file but the best thing to do is to get in touch with VC support team or to not use Ajax reloads.
add_action('init', 'add_mapped_shortcodes_on_init');
function add_mapped_shortcodes_on_init() {
WPBMap::addAllMappedShortcodes();
}