Home › Forums › JavaScript › Registering and referencing jQuery scripts the right way in WordPress › Re: Registering and referencing jQuery scripts the right way in WordPress
July 22, 2011 at 12:31 pm
#83796
Member
This is what I’ve most recently used in my functions.php:
if( !is_admin()){
wp_deregister_script('jquery');
wp_register_script('jquery', ("http://code.jquery.com/jquery-1.6.2.min.js"), false, '1.6.2');
wp_enqueue_script('jquery');
}
It sort of resets everything. The !is_admin is important because you don’t want to be messing around with the backend.
Then, in your header.php, you’ll want to put:
…just before the closing head tag.