Okay
  Print

How to Add a New Google Font

You can add a new Google Font into your customizer. In this article, we'll show how to add the Lato font.


1) Go to "Appearance > Editor" and open customizer.php file from the right side and search for the line below:

class blake_von_hauer_FontSelector extends WP_Customize_Control {

2) You'll see that the font names are listed in option tags. Now add the line below:

<option value="lato" <?php if( $this->value() == 'lato' ) echo 'selected="selected"'; ?>>Lato</option>

3) Save the file.

4) Open functions.php file from the right side and search for the line below:

function blake_von_hauer_fonts_url()

5) Add the line below:

_x( 'on', 'Lato font: on or off', 'robin' ),

6) Search for the line below:

$font_customizer_names = array(

7) Add the line below:

'lato' => 'Lato:400,400italic,700,700italic',

8) Search for the line below:

$font_css = array(

9) Add the line below:

'lato' => 'font-family: "Lato", sans-serif;',

10) Save the file and you're done! You can see and use your new font on your customizer.