Title: jQuery and Custom Script not loading
Last modified: August 20, 2016

---

# jQuery and Custom Script not loading

 *  [blaumond](https://wordpress.org/support/users/blaumond/)
 * (@blaumond)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/jquery-and-custom-script-not-loading/)
 * I am using a theme which has lots of custom widgets in a widgets.php file. I 
   need to use jQuery and a custom script for 2 of these widgets which will load
   on the home page.
 * I have `wp_enqueue_script('jquery');` on the header.php file before the wp_head
   function. And I am adding the custom script below the wp_head function. However,
   nothing works when I load the page. If I place the jquery file and the custom
   script inside each or both the widgets, it works on the first widget but not 
   on the second one. Can some one please tell me how to get this working?

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

 *  Thread Starter [blaumond](https://wordpress.org/support/users/blaumond/)
 * (@blaumond)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/jquery-and-custom-script-not-loading/#post-2837842)
 * Thanks for the support!
 *  [Chris Olbekson](https://wordpress.org/support/users/c3mdigital/)
 * (@c3mdigital)
 * [13 years, 11 months ago](https://wordpress.org/support/topic/jquery-and-custom-script-not-loading/#post-2837846)
 * remove all that from header php and add this to functions.php
 *     ```
       function blmd_load_scripts() {
               wp_enqueue_script( 'custom-script', '/path_to/your_script.js', array( 'jquery'), false);
       }
   
       add_action( 'wp_enqueue_scripts', 'blmd_load_scripts' );
       ```
   
 * This is using the wp_enque_script() and telling it your script depends on jquery.
   WordPress will make sure jQuery is properly loaded along with your custom script.(
   Unless your theme or another plugin is altering something)
 * Your welcome for the free support !

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

The topic ‘jQuery and Custom Script not loading’ is closed to new replies.

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [Chris Olbekson](https://wordpress.org/support/users/c3mdigital/)
 * Last activity: [13 years, 11 months ago](https://wordpress.org/support/topic/jquery-and-custom-script-not-loading/#post-2837846)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
