Skip Navigation

[Resolved] Visual composer issue

This thread is resolved. Here is a description of the problem and solution.

Problem: I'm seeing Visual Composer shortcodes written onto the page when I update a View using AJAX.

Solution: Add the following custom code to help display shortcodes from Visual Composer more effectively after an AJAX update:

/* --------------------------------------------- */
// VC RENDER SHORTCODES AFTER AJAX
add_action('init', 'add_mapped_shortcodes_on_init');
function add_mapped_shortcodes_on_init()
{
  WPBMap::addAllMappedShortcodes();
}
This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by Anonymous 7 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#571287

Anonymous
download.jpg
download (1).jpg

Hi, I created a view with a custom search.
hidden link
hidden link
The template of the results is created using Visual Composer.

On the page loading there are already shown some results, correctly.
After changing some filed in the search, everything is messing out

Why?

#571456

That's most likely because you're using AJAX to update the results. Try adding this code to your functions.php file to cause Visual Composer shortcodes to be rendered for AJAX updates:


/* --------------------------------------------- */
// VC RENDER SHORTCODES AFTER AJAX
add_action('init', 'add_mapped_shortcodes_on_init');
function add_mapped_shortcodes_on_init()
{
  WPBMap::addAllMappedShortcodes();
}
#571468

Anonymous

Working now!
Thanks