Title: Problems with wp_enqueue_script in functions.php
Last modified: August 19, 2016

---

# Problems with wp_enqueue_script in functions.php

 *  [vehemoth](https://wordpress.org/support/users/phunz/)
 * (@phunz)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/problems-with-wp_enqueue_script-in-functionsphp/)
 * Hi WP forums,
 * I’m pretty much a beginner developer and am having some issues getting jquery(
   and other js) to run through the functions.php theme file.
 *     ```
       <?php
       function load_scripts() {
       	  wp_enqueue_script( 'jquery' );
       }
       add_action('init', 'load_scripts');
       ?>
       ```
   
 * That the only bit of code within my functions.php. When I use the chrome developer
   console, I can see that jquery is not loading. Am I missing a step?
 * Many thanks in advance for any help I can get.

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

 *  Thread Starter [vehemoth](https://wordpress.org/support/users/phunz/)
 * (@phunz)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/problems-with-wp_enqueue_script-in-functionsphp/#post-1771475)
 * Ok, I’ve tried everything I can possibly think of – nothing is working except
   adding the scripts into the footer via html:
 * `<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"
   ><script src="../js/script.js?v=2"></script>`
 * functions.php is firing, but the wp_enqueue_script seems to be failing, so I’ve
   tried placing into footer.php like so:
 *     ```
       <?php 
   
       		wp_register_script('custom_script', get_bloginfo('template_directory') . '/js/script.js', array('jquery') );
   
       		wp_enqueue_script('custom_script');
   
       	?>
       ```
   
 * ..to no avail.
 * In functions.php, also not working:
 *     ```
       <?php
   
       function load_scripts() {
   
       	if ( !is_admin() ) {  
   
       		wp_register_script('custom_script', get_bloginfo('template_directory') . '/js/script.js', array('jquery') );
   
       		wp_enqueue_script('custom_script');
   
       	}
   
       }
   
       add_action('init', 'load_scripts');
   
       ?>
       ```
   
 * I can’t imagine it’s a bug or something. I assume I’ve missed a step, and cannot
   find a solution, can anyone help?
 * Thanks,
 *  [Matt McInvale](https://wordpress.org/support/users/mcinvale/)
 * (@mcinvale)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/problems-with-wp_enqueue_script-in-functionsphp/#post-1771476)
 * does your theme include the required calls to wp_head and wp_footer?
 *  Thread Starter [vehemoth](https://wordpress.org/support/users/phunz/)
 * (@phunz)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/problems-with-wp_enqueue_script-in-functionsphp/#post-1771477)
 * Thank for your speedy reply, Matt.
 * My theme has
 *     ```
       <?php get_header(); ?> 
   
       /*html*/
   
       <?php get_footer(); ?>
       ```
   
 * it is also a custom page, could this be an issue?
 *  [Matt McInvale](https://wordpress.org/support/users/mcinvale/)
 * (@mcinvale)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/problems-with-wp_enqueue_script-in-functionsphp/#post-1771478)
 * Open up header.php and footer.php and look for wp_head(); and wp_footer();
 *  Thread Starter [vehemoth](https://wordpress.org/support/users/phunz/)
 * (@phunz)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/problems-with-wp_enqueue_script-in-functionsphp/#post-1771479)
 * Ah, I just learned so much from that bit of info. Problem solved, thanks heaps
   Matt!

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

The topic ‘Problems with wp_enqueue_script in functions.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 2 participants
 * Last reply from: [vehemoth](https://wordpress.org/support/users/phunz/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/problems-with-wp_enqueue_script-in-functionsphp/#post-1771479)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
