Last active
August 29, 2015 13:58
-
-
Save rkjha/10091723 to your computer and use it in GitHub Desktop.
Add this to theme's `function.php`, in order to load jQuery from google cdn and jquery migrate from jQuery cdn (don't forget to update the plugin version)
This file contains 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
/* loads minified jQuery (1.10.2) from Google CDN and jQuery migrate from jQuery CDN */ | |
function jquery_cdn() { | |
if (!is_admin()) { | |
wp_deregister_script('jquery'); | |
wp_deregister_script('jquery-migrate'); | |
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js', false, '1.10.2'); | |
wp_register_script('jquery-migrate', 'http://code.jquery.com/jquery-migrate-1.2.1.min.js', false, '1.2.1'); | |
wp_enqueue_script('jquery'); | |
wp_enqueue_script('jquery-migrate'); | |
} | |
} | |
add_action('init', 'jquery_cdn'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment