JQuery and WordPress

JQuery and WordPress

If you are trying to add your own jQuery code to WordPress, and have had the error “$ is not a function” show up on Firebug, here is the fix:

Convert all dollar signs ($) to ‘jQuery’
The dollar sign is reserved in WordPress for the Prototype library, which is why it errors out. For example, instead of:

$().ready(function() {
$(“#select_me”).show();
});

Change it to:

jQuery().ready(function() {
jQuery(“#select_me”).show();
});

Deepak Sihag

Deepak is a Technical consultant, working on web since last 12 years. He excels in Microsoft .Net, OpenSource (mainly WordPress customization & plugin development) as well love working with CRM. He has been working with startups to listed companies and help them to build their online presence and reach target audience.

More Posts - Twitter - LinkedIn