Include style.css in the Child Theme with PHP

In is written that the best practice for including style.css in the Child Theme one must put the code below into the functions.php of your Child Theme but replacing the ‘parent-style’ with the parametr of your Parent Theme which can be found in the functions.php of your Parent Theme. I couldn’t find that in the file of my Theme, and there is not much of a code there. The method to include the Parent Theme stylesheet using @import is not working for me, the css that put in the file are not displaying themselves on the site in any browser.

function my_theme_enqueue_styles() {

$parent_style = ‘parent-style’; // This is ‘twentyfifteen-style’ for the Twenty Fifteen theme.

wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ );
wp_enqueue_style( ‘child-style’,
get_stylesheet_directory_uri() . ‘/style.css’,
array( $parent_style ),
add_action( ‘wp_enqueue_scripts’, ‘my_theme_enqueue_styles’ );

And I have one working example of this enqueue but for a different theme:

* Enqueue the parent theme stylesheet.

add_action( ‘wp_enqueue_scripts’, ‘vantage_parent_style’ );
function vantage_parent_style() {
wp_enqueue_style( ‘parent-theme’, get_template_directory_uri() . ‘/style.css’ );

* Enqueue the child theme stylesheet.

add_action( ‘wp_enqueue_scripts’, ‘vantage_child_style’, 20 );
function vantage_child_style() {
wp_enqueue_style( ‘child-theme’, get_stylesheet_uri() );

The name of my Theme is Samsklad and I don’t know how to implement the code within my Child Theme’s functions.php, I’m no good with PHP.

Read more here:: Include style.css in the Child Theme with PHP

Leave a Reply

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