Hello everybody! I’m looking an advice, if you have experience with new Visual Composer Frontend builder, please.
I use “wp_enqueue_scripts” to load my front-end JS, but it doesn’t work when i add a shortcode in VC front editor.
thank you so much
Have you viewed the page source in the browser and checked to see whether the JS path is actually valid / resolves? Any errors in the console?
Regardless of whether you use “wp_enqueue_scripts” or no, if it’s a bad url then it’s not going to load. Where / in what file are you enqueuing? Are you using an hook to run the enqueue code? This is all not at all specific to VC but JS and WP.
Aside from that also have a look here for VC specifics when you’re sure of the rest – http://kb.wpbakery.com/index.php?title=Category:Visual_Composer
This is all not at all specific to VC but JS and WP.
Thank you for reply.
There are no errors in JS console, also i read documentation and tried to get support from WPBakery, they promised write me an example, the right way to init JS, but promises remained promises for the past two weeks, it is sad
I will try to explain
I keep all the JS functions for front-end in a single file, it loads and works well, as the rest parts of the theme works fine, like widgets, that uses JS from that file.
I believe that i need to call some hook to init my carousel when shortcode is loaded, but i did not find any docs how to do that.
i’ve found a temporary solution, to call JS function in a shortcode template, but I’m not sure that this is a right way. what do you think? anyway thanks for your answers!