Skip to:
Content
Pages
Categories
Search
Top
Bottom

Child theme .CSS doesn’t overwrite default theme .CSS

  • Avatar of graphicscove
    graphicscove
    Member

    @graphicscove

    Right! So before I start pulling my hair out over this one I have a quick question. A search via Google gave a few limited responses to my query but nothing has worked that was suggested (if anything).

    So I have a child theme of the default buddypress theme. The thing is, I added ‘body’ styles to the child theme .css but when viewing the site it still shows up ‘body’ styles from the default theme. When looking at Firebug to see what was going on it was using ‘body’ styles from both the default theme AND the child theme.

    I have no idea what’s gone wrong here, any help would be appreciated. Here’s a link to the project: http://graphicstudents.co.uk/

    As you can see I’m trying to get that black bar at the very top to go all the way across the width of the page but the body styling from the default theme is keeping it centred. If my child theme successfully overwrote the default then I wouldn’t have a problem.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    I had the same problems before and my fix is to cut the content from the default CSS and place it in your child theme. I also like this method as I can just edit everything in one file no need to worry about cascading

    Avatar of graphicscove
    graphicscove
    Member

    @graphicscove

    I did think about that but wanted to avoid it since the whole idea of the child theme is to replace the default but keep the default intact in case it needs to fall back on something. I guess I’m going to have to do that anyway.. Thanks.

    Avatar of @modemlooper
    @modemlooper
    Moderator

    @modemlooper

    Are you enqueing your CSS are just plopping it in the head with <link….

    You should enque it in your themes functions.php file

    Avatar of graphicscove
    graphicscove
    Member

    @graphicscove

    I don’t think I’ve actually done the functions.php thing.

    I’ve created a separate theme directory with a style.css noting within the file that the parent is the Buddypress default theme.

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

You must be logged in to reply to this topic.