WordPress.org

Ready to get started?Download WordPress

Forums

Child theme css file not overiding parent css file (9 posts)

  1. simbennett
    Member
    Posted 7 months ago #

    Hello!

    My site – 12field.com.au, I'm using WordPress 3.6, referencing a theme called Ronika.

    As it’s best practice for modifications, I've set up a child theme. I have created a new folder in the Themes folder, and named it 12field. In that folder I have a new copy of the .css file, ready for my modifications. At the top have this information, referencing the Template and an @import link.

    Theme Name: 12field
    Version: 1.0
    Author: Simone Bennett
    Template: ronika

    @import url(“../ronika/style.css”);

    But when I make changes to the .css file in the child folder, nothing happens. If I make changes to the .css file in the Ronika folder, then the changes appear fine. I don't even think Ronika is loading my child .css file at all. It's like it doesn't exist.

    The php files in the Child folder change fine.

    Been playing with it for hours, I've contacted the theme's developer and he doesn't know.

  2. But when I make changes to the .css file in the child folder, nothing happens.

    Have you activated that theme? Looking at your site only shows the Ronika theme.

    This URL http://www.12field.com.au/wp-content/themes/12field/style.css is not correct either. You've copied the whole parent CSS file into there and that's not necessary.

    It should just be something like this.

    /*
    Theme Name:     12field Theme
    Description:    Child theme for the Ronika theme
    Template:       ronika
    Version:        1.0
    */
    
    @import url("../ronika/style.css");

    See how the @import is after the */ comment mark? It needs to be outside of the comments in order to work. After that line try your CSS rules.

  3. simbennett
    Member
    Posted 7 months ago #

    Thanks for helping, Jan!

    I made your changes to the child css file. Now it only has one rule in it AFTER the */ comment mark.

    In my rules I've made the font Times New Roman. It still won't change though. It remains 'Signika' font from the parent css.

    The 12field Theme is activated the the Themes section of my dashboard. It says:

    Current Theme
    12field
    By Anonymous
    Version 1.0
    Child theme for the Ronika theme
    This child theme requires its parent theme, ronika.

    I've got my own theme thumbnail in there too that's appeared.

  4. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 7 months ago #

    At the moment can you activate your Child Theme?

  5. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 7 months ago #

    Have you also talked with the theme's vendors as to whether that theme supports Child Themes?

  6. simbennett
    Member
    Posted 7 months ago #

    Hi Andrew, thanks for helping :)

    Yes, in the dashboard I can activate the Child Theme. It appears, with my custom thumbnail, name, version, author info. I activate it and it appears at the top of the page with no error message. Current Theme
    twelvefield it says.

    I have contacted the parent theme's developer. He can't tell me why it's not working (not sure how deeply he thought about it though).

  7. Andrew Nevins
    Spam zapper & Volunteer Moderator
    Posted 7 months ago #

    I assume that theme doesn't support Child Themes.

  8. Andrew is onto something *waves in the direction of Andrew* and some theme's don't follow best practices and can't/won't be turned into a child theme.

    If you've followed the child theme instructions correctly and it's still not working then you'll really need the theme author to support you and explain what your options are.

  9. simbennett
    Member
    Posted 7 months ago #

    Yep, I've contacted the developer, hopefully he'll get back to me soon.

    My guess is that the parent stylesheet is being loaded after the child, or the child is being ignored completely, because of something in the functions.php file or header.php file.

    I see 'get_template_directory' written several times in functions.php.

    Down the bottom of this tread it's mentioned: http://wordpress.org/support/topic/child-theme-help-parent-stylescss-still-showing?replies=7

Reply

You must log in to post.

About this Topic