Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Nikki Pierre
Nikki Pierre
2,916 Points

Can I use Google fonts in boostrap in place of bootstrap fonts by putting a link to the font in the header.php file?

I want to use Google web fonts instead of the bootstrap fonts. If I link to the google font in the header.php file and choose the font I want in my style.css sheet will this overwrite the bootstrap css our will I have to go into the bootstrap css and manually remove all references to their fonts? I hope this makes sense!

1 Answer

Kevin Korte
Kevin Korte
28,149 Points

Yes, you can override it that way. The bootstrap font's are pretty low level CSS since they are applied to the entire site. Any CSS references to a different font should easily override the default bootstrap fonts. Just be sure that your CSS file you are using to override and declare fonts loads after the bootstrap file does, and that is part of CSS's Cascading Style Sheets logic.

Also, make sure you probably include the CSS file for your google fonts using your functions.php file and the wp_enqueue_style function. Do not just paste the CSS code Google Fonts gives you directly into your header.php file.

Nikki Pierre
Nikki Pierre
2,916 Points

thanks ALOT Kevin, will do!