Title: wp_enqueue_script issues
Last modified: August 20, 2016

---

# wp_enqueue_script issues

 *  Resolved [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/)
 * hi, the scripts i enqueued in functions.php for my theme using `wp_enqueue_script()`
   arent displaying in source code, when site is loaded, indicating that the scripts
   aren’t being loaded in wp_head().
    i check to see if they are queued with `wp_script_is('
   queue')` it returns true for all of them however `wp_script_is('to_do')` and `
   wp_script_is('done')` return false here is my code:
 *     ```
       function goldrush_js_enqueue(){
   
       wp_deregister_script( 'jquery' );
       wp_enqueue_script( 'jquery' );//wordpress provided jQuery library
       wp_enqueue_script( 'jquery.tweet', get_template_directory_uri() . '/js/jquery.tweet.js', array('jquery'));
       wp_enqueue_script( 'flexislider',get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'));
       wp_enqueue_script( 'menujs',get_template_directory_uri() . '/js/menu.js', array('jquery'));
       wp_enqueue_script( 'flicker',get_template_directory_uri() . '/js/jflickrfeed.min.js', array('jquery'));
       wp_enqueue_script( 'quicksand',	get_template_directory_uri() . '/js/custom.quicksand.js', array('jquery'));
       wp_enqueue_script( 'prettyphoto',get_template_directory_uri() . '/js/jquery.prettyPhoto.js', array('jquery'));
       }
       add_action('wp_enqueue_scripts', 'goldrush_js_enqueue');
       ```
   
 * please help, its urgent, thanks

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

 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063550)
 * URL?
 * Why do you deregister ‘jquery’ only to register it again?
 *  [Max](https://wordpress.org/support/users/clementsm/)
 * (@clementsm)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063556)
 * If you deregister is, you cannot simply run:
 * `wp_enqueue_script( 'jquery' );`
 * afterward, as the process of de-registering it actually removes WordPress’ reference
   to it, and it will not know where to find it, so nothing that depends on it will
   get enqueued.
 * You should remove both the following lines:
 *     ```
       wp_deregister_script( 'jquery' );
       wp_enqueue_script( 'jquery' );
       ```
   
 * in your function, since you have jQuery listed as a dependency in every-other
   call… it will be added automatically.
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063559)
 * Oops, good catch, Max. He doesn’t re-register it. He just tries to re-enqueue
   it.
 *  Thread Starter [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063597)
 * Hi, Max removed both lines but still no joy.
    However, `wp_script_is( $handle,
   $list = 'queue')` returns true when tested on all the script handles except when
   the handle is ‘jquery’ where it returns false meaning jQuery library doesn’t 
   get enqueued.
 * Also this function returns false on all $handle when $list = ‘to_do’.
 * please help…
 *  Thread Starter [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063598)
 * I wanted to note that when i put
    `wp_enqueue_script( 'jquery' );` at the top
   of my functions.php file outside the `function goldrush_js_enqueue(){}` `wp_script_is('
   jquery', $list = 'queue' )` returns true cant understand why….
 *  [s_ha_dum](https://wordpress.org/support/users/apljdi/)
 * (@apljdi)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063599)
 * That strikes me as somewhat odd behavior. Is there a plugin, or perhaps some 
   other component of your theme, that might be messing with jQuery registration?
   Can you post an URL?
 *  Thread Starter [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063600)
 * its still on my production machine its not live yet but i will install afresh
   copy of wordpress and try it out
 *  Thread Starter [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063602)
 * i just put the theme on a fresh install of wordpress and still cant get the scripts
   to run. Here is the URL:
 * `http://www.goldrushbeauty.com/`
 *  [Max](https://wordpress.org/support/users/clementsm/)
 * (@clementsm)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063603)
 * jQuery is still not being loaded… can you past your `functions.php` to [pastebin](http://pastebin.com/)
   so we can look at it…
 * Also your `header.php` as I notice there is some inline script that is being 
   output before the scripts that are being enqueued by WordPress.
 *  Thread Starter [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063604)
 * <script src=”[http://pastebin.com/embed_js.php?i=pZKrLxRV”></script&gt](http://pastebin.com/embed_js.php?i=pZKrLxRV”></script&gt);
 *  [Max](https://wordpress.org/support/users/clementsm/)
 * (@clementsm)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063605)
 * I think I will download that theme, as I notice that is including a setup file,
   @s_ha_dum is right when he says that is odd behaviour…
 * I did notice one small issue:
 * You are missing a jQuery dependency in
 * `wp_enqueue_script( 'jquery.tweet', get_template_directory_uri() . '/js/jquery.
   tweet.js');`
 * This is however not the cause of the other issue… Will post back in a min when
   I have looked at the theme…
 *  Thread Starter [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063606)
 * functions.php posted in pastebin
    [](http://pastebin.com/embed_js.php?i=pZKrLxRV)
 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063608)
 * What you’ve posted here will never work as a link (thank goodness too!) but this
   will.
 * [http://pastebin.com/pZKrLxRV](http://pastebin.com/pZKrLxRV)
 * Please see this link for instructions on [how to use pastebin.com](http://codex.wordpress.org/Forum_Welcome#Posting_Code).
 *  Thread Starter [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063609)
 * Thank you Jan,
 * I failed to mention that im using wordpress v3.3.2, i hope this will help in 
   solving the issue.
 *  Thread Starter [iAyo](https://wordpress.org/support/users/iayo/)
 * (@iayo)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063614)
 * Hi,
    figured out what was wrong, the scripts and styles were added below the 
   output of functions i attached to the `wp_script_styles()` hook. I now need to
   figure out why the `$priority` isn’t making them print immediately after wp_head().
 * I thank you all for your help…..

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

The topic ‘wp_enqueue_script issues’ is closed to new replies.

## Tags

 * [wp_enqueue_script](https://wordpress.org/support/topic-tag/wp_enqueue_script/)
 * [wp_head](https://wordpress.org/support/topic-tag/wp_head/)

 * 15 replies
 * 4 participants
 * Last reply from: [iAyo](https://wordpress.org/support/users/iayo/)
 * Last activity: [13 years, 8 months ago](https://wordpress.org/support/topic/wp_enqueue_script-issues/#post-3063614)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
