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

I am using a few jQuery plugins such as validate.js, but they all load BEFORE the Jquery library which is loaded automatically by WordPress and my theme.

I need the plugins to load after - so is there a way to make Jquery load first in functions.php - so that I can use it frontend and admin.

I am currently loading the following in functions.php

get_bloginfo('template_url') ."/js/jquery.validate.min.js");

get_bloginfo('template_url') ."/js/scripts.js");

Any help, massively appreciated!

share|improve this question
up vote 9 down vote accepted

If you look at the wp_enqueue_script Codex Documentation, you'll see one of the options is $deps, this would mean that your script is dependent upon another script, simply add jquery as a dependancy and your scripts will load in the correct place.

If you set a handle for the other scripts you can use them as a dependent as well.


    get_bloginfo('template_url') . '/path/script.js', 
    array( 'jquery' ) 
share|improve this answer
Cheers JK - seemed to get it working by simply ordering it in functions.php - yet when I tried it the first time it didn't work. Using dependencies is definitely the way to go! – Adam Moss Nov 29 '11 at 14:58

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.