Posted By

scribbleitdesigns on 07/03/10


Tagged

wordpress


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

artificialid
maxvee8
mikoli


Calling jQuery 1.4.2 via wordpress


 / Published in: PHP
 

This is a custom function to place in your theme's "functions.php" file that will override the typical 1.3.2 version of jQuery included in wordpress with the latest 1.4.2 version (and any future release for that matter). This does not effect the admin section as it has been removed via ' !is_admin()'

  1. <?php // Call version 1.4.2 instead of 1.3.2. from Wordpress
  2.  
  3. function jquery_latest() {
  4. if ( !is_admin()) {
  5. wp_deregister_script( 'jquery' );
  6. wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', false, '1.4.2' );
  7. }
  8. }
  9. add_action('init', 'jquery_latest');
  10. // Call in head
  11. wp_enqueue_script( 'jquery' );

Report this snippet  

You need to login to post a comment.