Adding a Google font through a function


show more Adding a Google font through a function provides you with in-depth training on Web. Taught by Morten Rand-Hendriksen as part of the WordPress 3: Building Child Themes show less
please wait ...

Adding a Google font through a function

Out of the box the twentytwelve theme uses a font from the Google Fonts library called Open Sans as its main font. Earlier in the course, I used CSS in my child theme to override that font so that we are instead using Georgia. But now I want to replace the Google Font Open Sans with a different Google Fonts using a function and enqueuing a style sheet. Before I do anything else, I need to get rid of the styles in the child theme style sheet that are causing the site to display using the Georgia font.

So I'll go to my child theme, find the style.css file, and find the style that's causing Georgia to be used. It's right here, so I'll simply remove that style and save the style sheet, go back and reload the page, and now we are using Open Sans as we should. The next step is to get rid of the Open Sans font, and here is something really cool. If you open functions.php from twentytwelve and scroll down a bit, you'll find a section where Open Sans is added. It's right h...

Adding a Google font through a function
Video duration: 6m 15s 3h 11m Intermediate Updated Nov 27, 2012

Viewers:

Adding a Google font through a function provides you with in-depth training on Web. Taught by Morten Rand-Hendriksen as part of the WordPress 3: Building Child Themes

Subject:
Web
Software:
WordPress
Author:
please wait ...