Jquery noconflict

In WordPress, jquery is configured not to define the $ variable since it may conflict with other libraries.
You are therefore encouraged to use jQuery(document).ready(…

But we are all creatures of habit and thus may prefer to use $. So simply add this line at the top of your js file / script tag

if (typeof($) == ‘undefined’) $ = jQuery.noConflict(); // added by Imran@cselian.com to use in wordpress

Leave a Comment