skip to Main Content

really hoping someone can please help me! I just updated the Divi parent theme on my WordPress site (www.ellymacdonalddesign.com), and the child CSS theme seems to have stopped working.

I’ve tried the solutions from this question, but they do not seem to work for me:
WordPress child theme style.css not working

My child functions.php file is currently:

<?php
function my_theme_enqueue_styles() {
    $parent_style = 'divi-style'; 
    wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( $child-style, get_stylesheet_uri() );
}
?>

Would really appreciate any guidance please, thank you in advance,
Elly

2

Answers


  1. Is your variable $child-style have any value? According to document, the handle name (first parameter) is required. That’s why your child theme still not working.

    Try below code to see if it’s work:

    add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
    function my_theme_enqueue_styles() {
        $parent_style = 'divi-style'; 
        $child_style = 'divi-style-child'; 
        wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
        wp_enqueue_style( $child_style, get_stylesheet_uri() );
    }
    
    Login or Signup to reply.
  2. Changing the css child theme version number helped solve the problem on my website.

    My child theme was working correctly until I decided to change some css rules in the style.css file from the WordPress ‘Theme Editor’ interface. I remarked that no changes appeared on the website, although the css was obviously loaded in the header and also I purged all cache.
    I tried solutions of the following question but I think this is for new child theme installation, not an already working one: WordPress child theme style.css not working

    I decided to change the version number of my child theme, and the modifications were finally taken into account.

    /*
     Theme Name:   Chromatic-child
     Template:     chromatic
     Version:      1.1.0
    */
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search