Why does wp_enqueue_style() in plugin not load stylesheet?

First thing to mention is that you don’t need to use wp_register_style if enqueuing within the same function. You can replace it with wp_enqueue_style and remove the duplicate.

As for why your stylesheet isn’t loading, start by checking the file path. Try this instead:

wp_enqueue_style('cl-chanimal-styles', plugin_dir_url( __FILE__ ) . 'css/cl-chanimal-styles.css' );

https://codex.wordpress.org/Function_Reference/plugin_dir_url

Leave a Comment