• Hi everybody. I’m seriously stumped. For some reason I can’t get WordPress to load my extra js files. The stylesheet loads fine, but the ‘extra.js’ file doesn’t even show up when I click inspect element and go to the debugger section to see the active files. Here’s my code:

    function importThemeResources () {
    
    		wp_enqueue_style("style", get_stylesheet_uri());
    		wp_enqueue_script("extra.js", get_template_directory_uri() . "/js/extra.js", array( 'jquery' ));
    		}
    
    	add_action("wp_enqueue_scripts", "importThemeResources");
Viewing 1 replies (of 1 total)
  • Moderator Jose Castaneda

    (@jcastaneda)

    THEME COFFEE MONKEY

    Hi hm107!

    In your console, do you see any errors? Often times the URL may be wrong so it may not load but the console will show a 404 for that file.

Viewing 1 replies (of 1 total)

The topic ‘Can't enqueue_scripts but I can enqueue CSS???’ is closed to new replies.