Add a CSS file via the child theme
-
I would like to add a custom CSS File to my OceanWP child theme but for some reason it isn’t loading.
function prefix_custom_styles() { // Dynamically get version number of the parent stylesheet (lets browsers re-cache your stylesheet when you update your theme) $theme = wp_get_theme( 'OceanWP' ); $version = $theme->get( 'Version' ); wp_enqueue_style('flags', get_stylesheet_directory_uri() . '/flags/flags.css' ); } add_action( 'wp_enqueue_styles', 'prefix_custom_styles' );
The above doesn’t work, can anyone see why?
Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Add a CSS file via the child theme’ is closed to new replies.