how to add custom stylesheets to storefront child theme
-
Hi
I’d like to load custom stylesheet to Storefront child theme. I don’t want to customize the css using the dashboard. I know I can add custom css to style.css, I want to be able to add my-custom.css and have it override (where needed) the parent’s styles.
I have tried
function afz_add_scripts_styles() { // register styles & scripts wp_register_style('afz-custom-style', get_theme_file_path('css/my-custom.css')); // enqueue our styles & scripts wp_enqueue_style('afz-custom-style'); add_action('wp_enqueue_scripts', 'afz_add_scripts_styles');
also tried
function afz_add_scripts_styles() { // register styles & scripts wp_register_style('afz-custom-style', get_template_directory_uri() . '/css/my-custom.css'); // enqueue our styles & scripts wp_enqueue_style('afz-custom-style'); add_action('wp_enqueue_scripts', 'afz_add_scripts_styles');
but neither work.
What am I missing, or doing wrong?
Thank you
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘how to add custom stylesheets to storefront child theme’ is closed to new replies.