Return to Snippet

Revision: 22858
at January 24, 2010 16:18 by chrisdpratt


Initial Code
<?php
  wp_deregister_script('jquery');
  wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js', false, '1.4.0');
  wp_enqueue_script('jquery');
?>
<?php wp_head(); ?>

Initial URL
http://www.prolificnotion.co.uk/adding-jquery-to-a-custom-wordpress-theme/

Initial Description
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.)

Initial Title
Load jQuery from Google AJAX Libraries API in Wordpress

Initial Tags
google, wordpress, jquery

Initial Language
PHP