Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

WordPress From Bootstrap to WordPress Create Bootstrap Styled Theme Templates Maintaining Your Theme as a Parent Theme

Why is the styling in my child theme being overridden by bootstrap in the parent theme?

For example I want to change the colour of the jumbotron class in my child theme. But when I make the change in style.css of my child theme and look in the Developer tools of the browser I can see that the changes in my child theme are being overridden by the styles defined in the bootsrap css file in the parent theme. Do I need to import bootstrap into my child theme as well?

johannbillar
johannbillar
9,028 Points

Hi Biswadip - I'm having a similar issue... I created a child-theme for the bootstrap-theme, created in this course.

How do I include the child-theme style.css file in the functions.php file so that it loads in the header.php?

Do I include it in the parent functions.php file? Or do I include it in the child's function.php file? And, if so how...?

Thanks! ~Johann

1 Answer

OK I managed to fix it. In functions.php you need to enqueue the bootstrap and css files in the parent theme BEFORE the style.css file in your child theme (then the styles in your child theme are loaded after the bootstrap and style files in the parent theme and so override them).