Wordpress - Why is style.css not being enqueued?

Theme stylesheets aren't usually enqueued, they're normally loaded using..

<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />

So naturally you don't see them(it) in the styles array..

You can of course(if you prefer) use an enqueue instead.


The recommended way to do it is by enqueue-ing style.css in the functions.php of the theme.

Add this to functions.php

 /**
 * Load CSS and JS the right way
 */
function myprefix_load_css_and_js() {
    wp_enqueue_style( 'style', get_stylesheet_uri() );
}
add_action( 'wp_enqueue_scripts', 'myprefix_load_css_and_js' );

You can refer this in the WordPress theme handbook here and see examples here.