WordPress.org

Ready to get started?Download WordPress

Forums

Child theme doesn't import parent's stylesheet (6 posts)

  1. safeart
    Member
    Posted 2 years ago #

    I've googled and searched wordpress support but I haven't been able to to find the answer to this. I'm trying to make a child theme of the Green Stimulus theme (https://github.com/livelylabs/Green-Stimulus-WordPress-Theme). The child theme activates but doesn't import the parent's stylesheet.

    Here's the code in the child theme's style.css file:

    /*
    Theme Name:     Green Stimulus Child
    Template:       green-stimulus
    */
    
    @import url("../green-stimulus/style.css");

    I got rid of everything but the required comments as per this suggestion. I don't have any code after the import rule.

    The site is at http://www.safeart.org/blog/
    Here's a screenshot of the parent theme on my site: http://i.imgur.com/NHo33.png

    I made a child theme for Yoko and it did the same thing, but a child theme of TwentyEleven worked fine. Is it something to do with the parent theme's style.css? Any idea how to fix this?

  2. cjc1867
    Member
    Posted 2 years ago #

    You haven't used quotes inside the brackets.

    Yours: @import url(../green-stimulus/style.css);
    No quotes, add some quotes as above and see if it works.

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    That shouldn't matter with any of the modern browsers.

  4. cjc1867
    Member
    Posted 2 years ago #

    It probably is loading in, you have 3 other style sheets referenced and they don't exist or not pointing to the right place especially the green.css one.

    Also you have referenced the child theme style sheet twice, the first one and the last one of the four.

    You need to sort out the other 3 and maybe it will work as the style sheet for the parent doesn't have much in it.

  5. safeart
    Member
    Posted 2 years ago #

    Thank you both for your help. I had tried formating the import with double and single quotes as well but that didn't work either.

    I think I see the other stylesheets in the source file... assets/css/globals.css, assets/templates/green/style.css, and assets/css/typography1.css are all in the parent folder (green-stimulus). I'm not sure how the child theme style sheet is being referenced twice. Could it be the server not clearing old versions of the file?

  6. cjc1867
    Member
    Posted 2 years ago #

    Looking at the source code:
    The other 3 style sheets in your header are being referenced from your child theme folder and not from green-stimulus's folder.

    Nothing to do with the server not clearing,it's in your header somewhere.

    See if you can sort the other 3 style sheets out first.

Topic Closed

This topic has been closed to new replies.

About this Topic