I am creating a child theme of a theme in WordPress. In Parent theme i have style.css and inside css folder of parent theme i have a base.css file ( and some more css files but the problem is only with base.css file ). Somehow it turns out that the sequence in which styles should be loaded is parent->base.css then parent->style.css the child->style.css. I want to ask whether the code below is correct way to do so ? To be specific it’s Enough Theme.

functions.php inside child theme

<?php
    function my_theme_enqueue_styles() {

        $parent_style = 'parent-style';
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css', array('enough_base') );

    }
    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles', 9 );
?>
<?php
    function enqueue_child_theme_styles() {
      wp_enqueue_style( 'child-style', get_stylesheet_uri(), array($parent_style) );
    }
    echo get_stylesheet_uri( );
    add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', 11);
?>
<?php

Read more here: Is this the correct way to load style sheets from parent theme and then from child theme in wordpress?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: