ThemeShaper Forums » Thematic

[closed]

Replace Jquery on wp_enqueue_script

(4 posts)
  • Started 2 years ago by SpacemanSpiff
  • Latest reply from helgatheviking
  • This topic is resolved
  1. SpacemanSpiff
    Member

    I notice that the wp_enqueue_script('jquery') on function.php is loading the version 1.4.4. This is because i'm using WP 3.1.4 due to the php version on my server.
    Is there a way to replace the old version of jquery with a newer one?

    Posted 2 years ago #
  2. this is not a thematic question, but why not upgrade wordpress to 3.3? that uses jquery 1.7ish i think. if not look in the codex for how to deregister a script.

    Posted 2 years ago #
  3. SpacemanSpiff
    Member

    I found the solution, this replaces the default jquery with the jquery hosted on google API.

    wp_deregister_script('jquery');
    wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', '1.7.2');
    Posted 2 years ago #
  4. yes and you should add that to the proper hook

    function kia_change_jquery(){
    wp_deregister_script('jquery');
    wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js', '1.7.2');
    }
    add_action('wp_enqueue_scripts','kia_change_jquery');
    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.