Child theme css

This topic contains 3 replies, has 3 voices, and was last updated by  Axle Support 3 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12181

    johnnyd
    Participant

    Hello mate it’s me yet again, I have decided to transfer all changes that have been made to the theme (even before me) to a child theme, now I am facing the following issue I can’t make the child css work. I am using the following code in the functions.php but doesn’t seem to do the trick.

    <?php
    add_action( 'wp_enqueue_scripts', 'best_commerce_child_enqueue_styles', 11 );
    function best_commerce_child_enqueue_styles() {
        wp_enqueue_style( 'child-style', get_stylesheet_uri() );
    }
    ?>
    
    <?php
    update_option( 'siteurl', 'https://tester.medicalfa.gr/test' );
    update_option( 'home', 'https://tester.medicalfa.gr/test' );
     
     /* This is the edited code for the functions.php of best-commerce-child*/
    
    add_action( 'wp_enqueue_scripts', 'enqueue_parent_styles' );
    
    function enqueue_parent_styles() {
       wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    }
    ?>
    #12188

    Axle Themes
    Keymaster

    Hi @johnnyd

    For child theme style you need to use get_template_directory_uri() and for the parent style, you need to use get_stylesheet_uri().

    You are doing just the opposite.

    #12199

    johnnyd
    Participant

    Thanks mate, I wouldn’t have thought of that!

    #12203

    Axle Support
    Moderator

    You are welcome. Happy to help you.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Child theme css’ is closed to new replies.