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 have a custom jquery file, here is code:

/* Custom JS */
    jQuery("#top-menu li:first-child a").addClass('selected');

And here my code to load js file in functions.php

add_action('wp_enqueue_scripts', 'load_custom_scripts');

function load_custom_scripts(){
    wp_enqueue_script('custom_script', THEMEROOT.'/js/custom.js', array('jquery'), true);

But when i check with firebug, my js not found. Hope anyone tell me what's wrong in my code?

enter image description here

share|improve this question

Run following in your terminal:

chmod 0644 /path/to/your/theme/js/common.js

This command has to give your file proper rights and your web server will be able to read it.

share|improve this answer
i'm build on localhost – Hung The Oct 1 '13 at 8:48
Do you use Windows? You need to check your file permissions. – Eugene Manuilov Oct 1 '13 at 8:49
i can use another wordpress theme, but when i'm building my own theme i get this problem? – Hung The Oct 1 '13 at 9:03

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.