Category: Uncategorized

How to Load jQuery from Google CDN

WordPress load its own copy of jQuery into your theme. But there are some advantages loading jQuery from google CDN.

Paste the code given below into your functions.php:

function load_googlecdn_jquery() {
	if (!is_admin()) {
		wp_deregister_script('jquery');
		wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js', false, '1.8.3');
		wp_enqueue_script('jquery');
	}
}
add_action('wp_enqueue_scripts', 'load_googlecdn_jquery');