how to enqueue javascript
-
Hi guys,
My theme uses old version of Jquery and it causes conflicts with many plugins. (https://wpdance.com/wordpress-themes/risusunit.html)
I need help enqueueing the javascript in header.php here.<script type="text/javascript"> jQuery('ul.sub-menu').each(function(){ jQuery(this).before('<div class="div-sub-menu"></div>'); jQuery(this).appendTo(jQuery(this).prev()); }); jQuery('.menu li').each(function(){ if(jQuery(this).children('.sub-menu').length > 0) jQuery(this).addClass('parent'); }); jQuery('.menu-top .menu > li:first').addClass('first'); jQuery('.menu-top .menu > li:last').addClass('last'); jQuery('.nav .menu > li:first').addClass('first'); jQuery('.nav .menu > li:last').addClass('last'); jQuery('.sub-menu').each(function(){ jQuery(this).children('li:first').addClass('first'); jQuery(this).children('li:last').addClass('last'); }); </script>
Does anybody know how to fix this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘how to enqueue javascript’ is closed to new replies.