WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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 used the following to enqueue jquery plugins:

    function my_scripts_method() {
            'custom functions',
            get_template_directory_uri() . '/js/main.js',
            'dotdotdot & lightbox',
            get_template_directory_uri() . '/js/plugins.js',
    add_action('wp_enqueue_scripts', 'my_scripts_method');

And I don't know it it's related but jquery only responds to calling jquery(... and not $(.... Why is that?

share|improve this question
up vote 4 down vote accepted

Use closure for your scripts:

    $(document).ready(function() {
        // do something...

It is safe way to use jQuery.

share|improve this answer

jQuery supplied with WordPress is in noConflict mode to avoid issues with other libraries that may use the $ as their object reference.

See wp_enqueue_script: jQuery noConflict wrappers for more info.

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.