Skip Navigation

[Gelöst] Visual composer issue

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 5 Jahre, 4 Monate. 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 Antworten, has 2 Stimmen.

Last updated by Anonym vor 5 Jahre, 4 Monate.

Assigned support staff: Christian Cox.

Author
Artikel
#571287

Anonym
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

Anonym

Working now!
Thanks