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


Warning: count(): Parameter must be an array or an object that implements Countable in /home/cselian/public_html/blog/wp-includes/class-wp-comment-query.php on line 405

Leave a Comment