• 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)
Viewing 1 replies (of 1 total)

The topic ‘Can load CSS but not JS? Problem with enqueue_scripts?’ is closed to new replies.