Title: wp_enqueue_scripts &#8211; what am I doing wrong?
Last modified: August 20, 2016

---

# wp_enqueue_scripts – what am I doing wrong?

 *  [saintehlers](https://wordpress.org/support/users/saintehlers/)
 * (@saintehlers)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-what-am-i-doing-wrong/)
 * Please let me get a direct answer instead of “go find an example” or “you’re 
   doing it wrong.” I know I’m doing it wrong, that’s why I’m asking.
 * So, this is what I have in my functions.php file
 *     ```
       function mdg_setup_scripts() {
         $mdgtemplateloc = get_bloginfo( 'template_url' ).'/js/';
         wp_register_script( 'hoverIntent', get_bloginfo('template_url').'/js/hoverIntent.js', array( 'jquery' ));
         wp_enqueue_script( 'hoverIntent' );
         wp_register_script( 'mdMenuAnimation', $mdgtemplateloc.'mdMenuAnimation.js', array( 'hoverIntent' ));
         wp_enqueue_script( 'mdMenuAnimation' );
       }
       add_action( 'wp_enqueue_scripts', 'mdg_setup_scripts' );
       ```
   
 * No <script> tag appears at all in the HTML generated.
 * Am I missing something I was supposed to put in the header.php to call this? 
   What did I do wrong?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Andrew Bartel](https://wordpress.org/support/users/andrew-bartel/)
 * (@andrew-bartel)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-what-am-i-doing-wrong/#post-2792648)
 * I’ve always put my javascript in the <head> tag, so, in the header. But some 
   people prefer it in the footer now.
 *  [Bob](https://wordpress.org/support/users/prasunsen/)
 * (@prasunsen)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-what-am-i-doing-wrong/#post-2792708)
 * You seem to be doing it right. I’m just having exactly the same problem on one
   blog (works fine on all other) – used “wp_enqueue_scripts” action but no script
   tag appears. I’ll write again if I find the source of the problem.
 *  [Bob](https://wordpress.org/support/users/prasunsen/)
 * (@prasunsen)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-what-am-i-doing-wrong/#post-2792709)
 * Andrew was right, when removing $in_footer argument it started working. Apparently
   some themes don’t properly call get_footer();

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘wp_enqueue_scripts – what am I doing wrong?’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [Bob](https://wordpress.org/support/users/prasunsen/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/wp_enqueue_scripts-what-am-i-doing-wrong/#post-2792709)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
