How to enqueue custom stylesheet for child theme
-
I have the following setup for my enqueueing stylesheets from my child theme…
function my_theme_enqueue_styles() { $parenthandle = 'twenty-twenty-one-style'; // This is 'twenty-twenty-one-style' for the Twenty Twenty-one theme. $theme = wp_get_theme(); wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( $parenthandle ), $theme->get('Version') // this only works if you have Version in the style header ); wp_enqueue_style('child_style', get_stylesheet_directory_uri() . '/dist/css/kl_wp_bundle.css', array('kl-theme-style'), '1.1.0', 'all'); wp_enqueue_script('fontawesome-script','https://kit.fontawesome.com/fcb2d73aa0.js', array(), NULL, true ); } add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
Everything is loading on the front end, except for my custom stylesheet kl_wp_bundle.css. Is any part that coding area incorrect?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to enqueue custom stylesheet for child theme’ is closed to new replies.