Answers for "how to add css in child theme in wordpress"

PHP
1

wordpress enqueue style child theme

// To enqueue the WordPress way your CSS sources
// INSIDE your theme/child functions.php:

function wp_starter_scripts() {
	wp_enqueue_style( 'wp-style-menu', get_template_directory_uri() . '/style-menu.css' );
	wp_enqueue_style( 'wp-style-buttons', get_template_directory_uri() . '/style-buttons.css' );
	wp_enqueue_style( 'wp-style-footer', get_template_directory_uri() . '/style-footer.css' );
  }
add_action( 'wp_enqueue_scripts', 'wp_starter_scripts' );
Posted by: Guest on October-02-2020
0

create child theme in wordpress

add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
    wp_enqueue_style( 'child-style', get_stylesheet_uri(),
        array( 'parenthandle' ), 
        wp_get_theme()->get('Version') // this only works if you have Version in the style header
    );
}
Posted by: Guest on January-23-2021

Code answers related to "how to add css in child theme in wordpress"

Browse Popular Code Answers by Language