I am trying to set up my WordPress so that it will use the most recent version of jQuery. Here is what I have done so far:
functions.php
<?
add_action( 'wp_enqueue_scripts', 'RegisterJQuery' );
add_action( 'wp_enqueue_scripts', 'EnqueueScripts' );
function RegisterJQuery()
{
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', false, "1.9.1" );
wp_enqueue_script( 'jquery' );
}
function EnqueueScripts()
{
wp_enqueue_script('karate', THEME_DIRECTORY . '/js/karate.js', 'jquery');
}
So everything in my 'karate' .js file is working as expected (including an alert that confirms that the version of jQuery has indeed been updated). However, my theme (Elegant Theme Chameleon) uses a mouseover effect on its menu to show submenus and this effect does not work anymore.
How can I figure out what is going on? My understanding is that if something was not compatible with the newer version of jQuery, it would still work if I upgraded the version (because of no-conflict mode). What do you think?
William
hover
which I think has been deprecarted in the latest version. – elclanrs Apr 3 at 6:05noConflict()
mode. Never replace the internal jQuery. – toscho♦ Apr 3 at 7:24