I've read about the WP enqueue_script() function, but if I wanted to use a newer version of jQuery than what my WP installation is using, can I load it through this & WP will use the latest version? or will it load both? or what will happen?
Thanks!
I've read about the WP enqueue_script() function, but if I wanted to use a newer version of jQuery than what my WP installation is using, can I load it through this & WP will use the latest version? or will it load both? or what will happen?
Thanks!
To replace the default jQuery url, do:
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'your custom url', ... );
Then call wp_enqueue_script( 'jquery' ); as usual.
Note that various pages in the WP admin might not be compatible with never versions of jQuery, not to mention plugin scripts.
You can (de)register the builtin jquery with the following functions:
wp_deregister_script('jquery');
And register a new jquery library:
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js', array(), '1.4', true);
null for version - that will suppress version tag on output and improve caching aspects.