How to load jQuery from Google CDN

August 23, 2013 at 5:31 pm

By default, WordPress load its own copy of jQuery in your theme. But what about loading the library from Google CDN? Here’s an easy way to do it.

Paste the code below into your functions.php file:

function jquery_cdn() {
   if (!is_admin()) {
      wp_register_script('jquery', '', false, '1.8.3');
add_action('init', 'jquery_cdn');

Once you saved the file, WordPress will load jQuery from Google CDN.

Thanks to WP for the recipe!