How to Fix jQuery Scripts for WordPress
Posted on 22. Jan, 2010 by Jeremy Reis in Website
WordPress uses the Prototype JavaScript library extensively throughout the core, so if you are implementing jQuery scripts you may be frustrated when they do not run, produce errors, or just don’t seem to work. The key is to replace the $ in your jQuery script with the word jQuery, for example, this code hides a paragraph:
$("div.contentToChange p.thirdparagraph").hide("slow");
If you placed that code into a WordPress page, it wouldn’t do anything. Instead, change the $ to jQuery, as in:
jQuery("div.contentToChange p.thirdparagraph").hide("slow");
Now, this code will properly function.

Leave a reply