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 understood that WordPress ALWAYS enqueues jQuery on all themes, thus it's reduntant to enqueue another jQuery with the same version.

However, while developing a theme, for testing purposes I moved it to a subdomain (same domain, another WP installation, no content but the "Hello World" post).

While the first enqueued normally the jQuery, the second stopped some functionalities and looking inside I've found that WordPress was not including jQuery automatically anymore.

The question is: Does WordPress wait for something (don't know, maybe a minimum of widgets on widget areas, menus, etc) to call the script? To make sure, do I have to enqueue the native jQuery manually? I'm developing a theme with the purpose to sell it on Theme Forest and they only allow the native WP jQuery (no way to dequeue it and add from another resource).

I'm using Wordpress 3.8

share|improve this question
Please learn more about WordPress before trying to make a commercial theme. – Wyck Mar 2 '14 at 4:22
Honestly I think that starting a project is the best way to learn something new and trying to make a commercial theme increases the responsibility to learn it well and on the right way. Also, your comment didn't aggregated any value to this question and sounded rude for me. If you can't help try at less to be gentle. – audaz802 Mar 2 '14 at 5:41
I agree, but it should not be commercial, would you built a house for someone with no experience? The question is very basic and it might be a better idea not just for your clients but your sanity to make a bunch of non-commercial themes first, or one for wordpress.org which has to pass a review team. – Wyck Mar 2 '14 at 16:03
up vote 1 down vote accepted

On the frontend, WordPress enqueues jQuery only when the admin bar is visible, usually only for users who are logged in.

If you need jQuery, enqueue it. It will not be included twice in this case.

share|improve this answer
Thanks toscho, since there is no redundancy, I think this is the best thing to do. – audaz802 Mar 2 '14 at 5:47

Do WordPress wait for something (don't know, maybe a minimum of widgets on widget areas, menus, etc) to call the script?

No. WordPress will load the script if you tell it to using the correct method.

You would use this method for loading scripts via your child themes functions file.

function my_scripts_method() {


get_bloginfo( 'stylesheet_directory' ) . '/js/custom_script.js', array( 'jquery' ));

add_action( 'wp_enqueue_scripts', 'my_scripts_method' )

Assumes your script is located in a folder named js in your child themes root directory.

For parent themes, replace:

get_bloginfo( 'stylesheet_directory' )


share|improve this answer
Thank you Brad. By now it is not the case since I'm not using a child theme but your code will be useful. – audaz802 Mar 2 '14 at 5:43
I've included what needs to be changed for parent themes. – Brad Dalton Mar 2 '14 at 9:24

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.