WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Below is my code for enqueue my scripts and css. I am trying to get the JavaScripts to load in the footer of my site, but when I view source I see them loading in the header. I suppose the "true" value isn't working properly or I have sequenced the code incorrectly?

// Enque CSS and JavaScript
if (!is_admin()) {

// CSS Reset
wp_register_style( 'reset', get_template_directory_uri() . '/css/reset.css');
wp_enqueue_style( 'reset' );

// 960 GS
wp_register_style( 'grid', get_template_directory_uri() . '/css/960.css');
wp_enqueue_style( 'grid' );

// Style
wp_register_style( 'style', get_template_directory_uri() . '/style.css');
wp_enqueue_style( 'style' );

// jQuery
wp_register_script('jquery',("http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"), true);

// jQuery UI
wp_register_script('jquery-ui-core',("https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/jquery-ui.min.js"), true);

// Easy Slider
wp_register_script('easy-slider',get_bloginfo('template_directory') . "/js/easySlider1.7.js", true);

// Scripts
wp_register_script('myscript',get_bloginfo('template_directory') . "/js/scripts.js", true);

// Facebook API
wp_register_script('facebook-loader',("http://static.ak.fbcdn.net/connect.php/js/FB.Loader"), true);
wp_register_script('facebook-sharer',("http://static.ak.fbcdn.net/connect.php/js/FB.Share"), true);

// Twitter API
wp_register_script('twitter',("//platform.twitter.com/widgets.js"), true);

share|improve this question
What hook are you using for this? You should be using wp_enqueue_scripts for both CSS and JS and you can ditch the is_admin check if you are. – Joseph Leedy Jul 30 '12 at 0:06
up vote 2 down vote accepted

You need top put it into an actual function and then call the function via an action, but to answer your question.

wp_register_script('easy-slider',get_bloginfo('template_directory') . "/js/easySlider1.7.js", true);

Your setting the third parameter to true but that param is for the $deps (dependency). The footer is the 5th parameter called $in_footer.

So it should be:

 wp_register_script('easy-slider',get_bloginfo('template_directory') . "/js/easySlider1.7.js", '', '', true);


 wp_register_script( $handle, $src, $deps, $ver, $in_footer );
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.