• Hi! I have made a child theme for the first time!
    I am using the Divi theme, from Elegant Themes.
    And I used the method that puts the following text in my child theme’s functions.php file:

    <?php
    function theme_enqueue_styles() {
    
        $parent_style = 'parent-style';
    
        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', 'theme_enqueue_styles' );
    ?>

    And the following in my style.css:

    01
    	/*
    02
    	 Theme Name:   divi child
    03
    	 Theme URI:    http://www.wpbeginner.com/
    04
    	 Description:  Child para usar o Divi sem problemas
    05
    	 Author:       Luisa Pietrobon
    06
    	 Author URI:   http://www.wpbeginner.com
    07
    	 Template:     Divi
    08
    	 Version:      1.0.0
    09
    	*/

    I have tried changing bought of them in many ways to see if I manage to make the child’s styles override the parents but all I do is to mess up my site…

    If someone knows the problem please help me! Thanks 🙂

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘My child theme styles.css doesn't override the parent's one.’ is closed to new replies.