Archived topic
Javascript error WPML
3 replies · Started by Antal on November 21, 2018
Hello Tom,
On a new WP install, with (child theme of) GeneratePress, Elementor and WPML I get a javascript error. This prevents the language to display correctly. (automatic language switcher). When I switch themes top TwentySeventeen the issue is gone.
Is this something that can be fixed?
app.js?ver=4.0.8:8 Uncaught ReferenceError: jQuery is not defined
at Object.<anonymous> (app.js?ver=4.0.8:8)
at r (app.js?ver=4.0.8:1)
at Object.<anonymous> (app.js?ver=4.0.8:8)
at r (app.js?ver=4.0.8:1)
at app.js?ver=4.0.8:1
at app.js?ver=4.0.8:1
Thanks :)
Kind regards,
Antal
Hi there,
GP doesn't enqueue jQuery by default, but that plugin should do seeing as it requires it, may be worth reporting it to the author. In the meantime you try this PHP snippet:
add_action( 'wp_enqueue_scripts', function() {
wp_enqueue_script( 'jquery' );
} );
Thanks David, I reported it back to WPML.
https://wpml.org/forums/topic/javascript-error-prevents-language-redirect/
Hope they can look a little deeper into this. :)
Thanks again.
Kind regards,
Antal
Ok keep us posted :)