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 brnhmbx_hunted_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 brnhmbx_hunted_fonts_url()

5) Add the line below:

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

6) Search for the line below:

$font_customizer_names = array(

7) Add the line below:

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

Have a look at the images at the end of the article if you're not sure what to write.

8) Search for the line below:

$font_css = array(

9) Add the line below:

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

Have a look at the images at the end of the article if you're not sure what to write.

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