How do I enqueue a .css file before style.css is loaded? Or make the default style.css dependant on another .css file?
I’m trying to load a .css reset, which style.css would overwrite.
Here’s what I have:
add_action('wp_enqueue_scripts', 'load_css_files');
function load_css_files() {
wp_register_style( 'normalize', get_template_directory_uri() . '/css/normalize.css');
wp_enqueue_style( 'normalize' );
}
However this is loaded after style.css.
Enqueue the
style.css
too, and setnormalize
as dependency:WordPress will load the dependencies now first automatically when
theme_name
is printed.