Grow your CSS skills. Land your dream job.

jquery in wordpress help

  • # March 20, 2012 at 11:15 pm

    I am having trouble getting my jquery to work in wordpress. I have called the script from the functions.php file and I can see it in the header when I view the source.



    function reservations_script(){
    wp_register_script('reservations', get_template_directory_uri() . '/js/reservations.js', array('jquery'));
    // enqueue the script
    wp_enqueue_script('reservations');
    }
    add_action('wp_enqueue_scripts','reservations_script');

    I can also see jquery being called in my header of my site

    but if I do a simple test in the header, nothing happens



    I have also tried $jQuery(document)

    Got any ideas?

    # March 20, 2012 at 11:24 pm

    jQuery is definitely being loaded? Are you using Google’s CDN or an uploaded copy?

    # March 20, 2012 at 11:28 pm

    I just got it working. I had to deregister jquery and then register they jquery from google.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".