Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom jquery file, here is code:

/* Custom JS */
jQuery(document).ready(function(){
    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
add comment

1 Answer

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 –  Thế Hùng 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? –  Thế Hùng Oct 1 '13 at 9:03
add comment

Your Answer

 
discard

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.