Enqueue Scripts in Functions File for Child THeme

, ,

This is what you need to include in the functions file of your child theme to include the parents style without having to do a @import in the css file.

function enqueue_custom_child_theme_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_uri(), array('parent-style')  );
}
add_action( 'wp_enqueue_scripts', 'enqueue_custom_child_theme_styles' );

 

Skills

Posted on

June 21, 2016

Submit a Comment

Your email address will not be published. Required fields are marked *