[resolved] Enqueuing jquery.min.js (5 posts)

  1. DesignLoud
    Posted 3 years ago #

    Alright, I know this should be simple but I am obviously looking over something. I am hoping someone can chime in with some help. I am trying to enqueue the Google JQuery lib and I just cant get it right to save me.

    Here is what I have, I have tried to deregister the jquery script and every other form/variation but just cant get it. I'm sure this has been answered thousands of times. Please be patient :D Thanks

    function wilmper_load_js_lib() {
    wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', array('jquery'));
    wp_enqueue_script( 'jquery' );
    add_action( 'wp_enqueue_scripts', 'wilmper_load_js_lib' );

    Please tell me where/what went wrong, thanks in advance!

  2. Andrew Bartel
    Posted 3 years ago #

    Why would you want to use 1.4.2 instead of the current version?

  3. DesignLoud
    Posted 3 years ago #

    Trust me I know, but I am modifying a theme for someone and thats what version the site resides on. It will save me alot of time if I can stick with that version until they upgrade

  4. DesignLoud
    Posted 3 years ago #

  5. microberto
    Posted 3 years ago #

    The above snippet should not be used for public sites. WordPress comes with its own jquery, just use it:


Topic Closed

This topic has been closed to new replies.

About this Topic