• Hi I am new to this and I was wondering how to add jQuery to my WP site. There are a number of ways but can anyone explain to me?

    Thanks in advance

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter spags88

    (@spags88)

    Hi Chantal, thanks for the reply, I have read this and I nwas having a few problems getting the jQuery to work properly. I am having a bit of trouble around the 2nd piece of code.

    <script type=”text/javascript”
    src=”<?php bloginfo(“template_url”); ?>/js/yourScript.js”></script>

    What information do i need to change here and do I need to download jQuery and put it in a specific folder?

    Thanks

    WordPress already has jQuery included. Some scripts however require a different version of jQuery, so you have to enqueue a different version (as mentioned in the article above). If that isn’t the case, just use the version that comes with WordPress. Be sure you have <?php wp_head(); ?> included in header.php

    Thread Starter spags88

    (@spags88)

    I have that included yes but my question was about this piece of script

    <script type=”text/javascript”
    src=”<?php bloginfo(“template_url”); ?>/js/yourScript.js”></script>

    Does this go in the header.php

    And what do I have to edit in this piece of code?

    Thanks

    Just put your .js in your theme folder (or in a subfolder js in your theme folder) and change “yourscript.js” in your own script.

    Thread Starter spags88

    (@spags88)

    HI SORRY FOR BEING A PEST I HAVE ALREADY DONE THIS AND ADDED THE .js FILE TO THE FOLDER. jQUERY IS NOT WORKING :-/

    HERE IS THE CODE I USED

    <script type=”text/javascript”
    src=”<?php bloginfo(“template_url”); ?>/js/hide.js”></script>

    CREATED THE HIDE.JS FILE

    caps not intended

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Adding jQuery to WP’ is closed to new replies.