Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Registering and referencing jQuery scripts the right way in WordPress Re: Registering and referencing jQuery scripts the right way in WordPress

#83796
TheDoc
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.