Beginner Beginner - 5 months ago 8
Javascript Question

jQuery conflict when adding a script

i'm using wordpress 3.9 and want to use this plugin in my theme . but when i want to add this :

var headhesive = new Headhesive('.header');


all scripts stop working in my theme .
how should i use this that works in my theme ?
i think that it's jQuery conflict

Answer

I assume you mean the $s conflict. If that's the case you can use <?php wp_enqueue_script("jquery"); ?> in your header.php file and add $.noConflict(); before you run any jquery code.

see: http://wpapi.com/wordpress-and-jquery-conflicts-how-to-solve-that/ for more info.

Comments