Really basic, I’m afraid. My scripts aren’t loading when I put them as part of a function triggered by the wp_enqueue_scripts
action in functions.php
. If I put them outside of that action as part of the main file, they load fine, but of course this is bad form. So:
wp_enqueue_style( 'intranet-style', get_stylesheet_uri() );
works but throws up errors in debugging but
function intranet_scripts() {
wp_enqueue_style( 'intranet-style', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'intranet_scripts' );
does nothing, it doesn’t even throw up any errors. I must be missing something super basic but I can’t for the life of me see what it is. I’ve had a look at similar questions here, and they all seem to revolve around trying to use wp_enqueue_script
to load a style, which I’m not doing. Help?
I was missing
wp_head()
from the template, so the action wasn’t firing, hence the function wasn’t triggered.