Title: how to enqueue javascript
Last modified: August 21, 2016

---

# how to enqueue javascript

 *  [ignpack](https://wordpress.org/support/users/ignpack/)
 * (@ignpack)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/how-to-enqueue-javascript/)
 * Hi guys,
    My theme uses old version of Jquery and it causes conflicts with many
   plugins. ([http://wpdance.com/wordpress-themes/risusunit.html](http://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)

 *  [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * (@wpyogi)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/how-to-enqueue-javascript/#post-3895463)
 * See: [http://codex.wordpress.org/Using_Javascript](http://codex.wordpress.org/Using_Javascript)

Viewing 1 replies (of 1 total)

The topic ‘how to enqueue javascript’ is closed to new replies.

## Tags

 * [enque](https://wordpress.org/support/topic-tag/enque/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [jquery](https://wordpress.org/support/topic-tag/jquery/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [WPyogi](https://wordpress.org/support/users/wpyogi/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/how-to-enqueue-javascript/#post-3895463)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
