Posted By

chrisdpratt on 01/24/10


google wordpress jquery

Versions (?)

Who likes this?

3 people have marked this snippet as a favorite


Load jQuery from Google AJAX Libraries API in Wordpress

 / Published in: PHP


Place the following code in header.php before the call to wp_head().

(If you do not include the exact version number when calling libraries from Google's AJAX Libraries API, a redirect is used to pull up the most current version. While this is handy, it prevents browsers from caching the script: effectively negating one of the major reasons for using Google's AJAX Libaries API.)

  1. <?php
  2. wp_deregister_script('jquery');
  3. wp_register_script('jquery', '', false, '1.4.0');
  4. wp_enqueue_script('jquery');
  5. ?>
  6. <?php wp_head(); ?>

Report this snippet  

You need to login to post a comment.