2 Corrections and clarification
source | link

YouFirst of all, you should declare your scripts using wp_enque_script. If

Second, jQuery is loaded automatically in WordPress and is set to no conflict mode. See the documentation for how to link a script that depends on jQuery.

Lastly, if you want it to appear on just one page you have two options

  1. SetupIn your functions.php file add a small plugin to, for example, have an option on each pagecustom field to either enable this script or not from the backendon that page.

  2. Manually insert it on a given page, for example:again via functions.php To target only the home page is_home() but of course you could just reference a page by it's page_id like this get_page( $page_id ).

Also, you may want to wrap your jQuery in a $(document).ready() closure.

You should declare your scripts using wp_enque_script. If you want it to appear on just one page you have two options

  1. Setup a small plugin to, for example, have an option on each page to either enable this script or not from the backend.

  2. Manually insert it on a given page, for example: is_home()

Also, you may want to wrap your jQuery in a $(document).ready() closure.

First of all, you should declare your scripts using wp_enque_script.

Second, jQuery is loaded automatically in WordPress and is set to no conflict mode. See the documentation for how to link a script that depends on jQuery.

Lastly, if you want it to appear on just one page you have two options

  1. In your functions.php file add a custom field to either enable this script on that page.

  2. Manually insert it on a given page, again via functions.php To target only the home page is_home() but of course you could just reference a page by it's page_id like this get_page( $page_id ).

1
source | link

You should declare your scripts using wp_enque_script. If you want it to appear on just one page you have two options

  1. Setup a small plugin to, for example, have an option on each page to either enable this script or not from the backend.

  2. Manually insert it on a given page, for example: is_home()

Also, you may want to wrap your jQuery in a $(document).ready() closure.