Hi,
On your site2 I can see that alternative message is working.
So the an-scripts.min.js is working and well enqueeud (no js error in the console).
I can also see that you are using W3 Total Cache, and compressing JS files. This plugin is hard to configure and may break your JS.
Did you try to disable the JS minify? Is the error still there ?
Cheers
Hello,
thank you very much for the quick response. The error is still there. I disabled minify, then I disabled W3 Total Cache completely, and finaly I disabled CSS and JS toolbox. Nothing worked, Modal has visibility:hidden. Have you got any other ideas?
Thanks
Hi there,
Sorry about that bug.
It looks like there is a JS error in an-scripts.min.js : “Uncaught TypeError: undefined is not a function”
The modal still has it visibility set to hidden because the JS failed.
I’m not sure why this error is triggered but I’m pretty sure this due to a plugin conflict.
Can you try to disable all your plugin to find the one is causing that bug?
Thanks
ok, I completely removed all the plugins, and did some more testing. The problem occurs in my child theme only, regardless of any other plugin. Is it possible that replacing jquery causes the problem?
function replace_jquery() {
if (!is_admin()) {
// comment out the next two lines to load the local copy of jQuery
wp_deregister_script(‘jquery’);
wp_register_script(‘jquery’, ‘http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js’, false, ‘1.11.1’);
wp_enqueue_script(‘jquery’);
}
}
add_action(‘init’, ‘replace_jquery’);
If you want to check my child function.php and style.css tell me where to send you.
Hi,
Did you try to remove this function ?
The plugin is compatible with the native WordPress jQuery version.
Great, that solved the problem!!!
The problem was the replace_jquery() function. Thank you very much for the help!
By the way, do you believe replacing jQuery is a good idea overall?
Glad to hear that!
Actually, it is a good idea to load it trought a CDN, like you did with googleapis.com. By this way you allow better performance because only 15 HTTP request can be done at the same time to the same HTTP domaine, and CDN are most of the time super fast.
BUT if you do that, you need to load the same version WordPress includes to prevent this kind of conflicts.
Finally, keep in mind that if the CDN is down, you’ll not have jQuery loaded and your site may break…
Ok, thanks for everything