Return to Snippet

Revision: 50471
at August 24, 2011 01:58 by adambundy

Initial Code

This must be inserted into the functions.php file:

function modify_jquery() {
	if (!is_admin()) {
		// comment out the next two lines to load the local copy of jQuery
		wp_register_script('jquery', '', false, '1.6.1');
add_action('init', 'modify_jquery');


This must be inserted into the header.php file (BEFORE WP_HEAD CALL!):

<?php wp_enqueue_script("jquery"); ?>


jQuery functions should be wrapped in this so that $ operator represents no-conflict (BELOW WP_HEAD):

<script type='text/javascript'>
jQuery(document).ready(function($) {
    // $() will work as an alias for jQuery() which is noconflict mode inside of this function


Initial URL

Initial Description

Initial Title
WordPress Enqueue jQuery - Google CDN

Initial Tags
wordpress, jquery

Initial Language