Created
July 4, 2014 02:34
-
-
Save vinacode/19d4300b930cecd6b84c to your computer and use it in GitHub Desktop.
Wordpress replace jquery default with Google API CDN jquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/**================Making jQuery Google API===================**/ | |
function use_google_api_jquery() { | |
if (!is_admin()) { | |
// comment out the next two lines to load the local copy of jQuery | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js', false); | |
wp_enqueue_script('jquery'); | |
} | |
} | |
add_action('init', 'use_google_api_jquery'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment