jQuery on WordPress
There is absolutely needed to outline how jQuery should be used together with WordPress because one can fail easily. I used my time to figure out what steps I need to undertake to have the perfect match.
Here are the rules you should follow if you want to use jQuery that is already present in WordPress installation. #1. You should edit your header.php file of your WordPress theme like this.
<?php wp_enqueue_script("jquery");?> <?php wp_head(); ?>
Comment: Your theme most probable has
wp_head() function in it and you should add the line BEFORE!!!!!!
wp_head() function add your jQuery code like this:
#3. The above code from #1 and #2 must be inside the
wp_head() tags of your header.php file in your theme.
Note that I have fond the similar explanation here.
Note that one can use theme functions.php file to add jQuery support. This can be done the following way:
If you updated your functions.php file this way than and your header.php file as shown above than your mouseover function will execute twice.
…tags: & category: -