Return to Snippet

Revision: 28185
at July 3, 2010 03:21 by scribbleitdesigns


Updated Code
<?php // Call version 1.4.2 instead of 1.3.2. from Wordpress

function jquery_latest() {
 if ( !is_admin()) {
  wp_deregister_script( 'jquery' );
  wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', false, '1.4.2' );
 }
}
add_action('init', 'jquery_latest');
// Call in head
wp_enqueue_script( 'jquery' );

Revision: 28184
at July 3, 2010 02:58 by scribbleitdesigns


Initial Code
<?php // Call version 1.4.2 instead of 1.3.2. from Wordpress

function jquery_latest() {
 if ( !is_admin() {
  wp_deregister_script( 'jquery' );
  wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js' );
 }
}
add_action('init', 'jquery_latest');
// If you want it listed in the wp_head function.....add it this way -
add_action('wp_head', 'jquery_latest');

Initial URL


Initial Description
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()'

Initial Title
Calling jQuery 1.4.2 via wordpress

Initial Tags
wordpress

Initial Language
PHP