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


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.

|improve this answer|||||
  • i'm build on localhost – Hung PD 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 PD Oct 1 '13 at 9:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.