• I have been trying to get Jquery to work for a while now and I still have no luck.

    Here is my code

    function load_jQuery() { // load external file  
        wp_register_script('jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"), false);
        wp_enqueue_script('jquery');
      }  
    add_action('wp_enqueue_scripts', 'load_jQuery');

    Any help is greatly appreciated!!!

Viewing 1 replies (of 1 total)
  • First, be aware that if you call wp_enqueue_script() with jquery as the first argument, you’ll get WordPress’ built-in jQuery, even if you’ve registered another script with the same handle. If you need to use a specific version of jQuery, you’ll need to register with a different handle:

    wp_register_script( 'robert-jquery', ("http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"), false);
    wp_enqueue_script( 'robert-jquery' );

    Beyond that, though, your code itself looks fine. Can you post a link to a page where jQuery isn’t loading properly?

Viewing 1 replies (of 1 total)

The topic ‘No Jquery in theme’ is closed to new replies.