Okay
  Print

How to add a New Font

Writer Blog theme includes a collection of Google Fonts, which you can find in

Appearance -> Fonts and colors -> Fonts.

 

2017-06-15_1553.png

 

 

However the list of available fonts can be expanded by adding new ones.

 

Adding a New Google Font

 

  1. Open the core.lists.php file in the /fw/core/ directory, and find the get_list_fonts() function. You'll see an array of Google fonts.

 

2017-06-15_1545.png

 

  1. Duplicate one of the font entries and replace the name of the font with your own. The line would look like this:

 

'Cabin Condensed' => array('family'=>'sans-serif'),

 

In order to enter the correct values, go to Google Fonts, select the font you're going to use, and check its CSS rules.

 

2017-06-15_1606.png

 

  1. Save the changes.

 

Now your new font is available in the font settings for all typography elements.

 

Adding a Custom Font

 

  1. In the css/font-face/ directory, create a new folder and give it a name of your font.

 

  1. The folder has to contain a @font-face kit, which would load your custom font on a webpage.

 

The easiest way to create it is by using a webfont kit generator, such as Font Squirrel Generator (visit our tutorial to see how to use it).

 

Extract the generated archive into /css/font-face/your-font-name.

 

Important! Make sure that the name of your folder corresponds with the font-family value in the stylesheet.css.

 

  1. The only thing left now is to register your font name in functions.php.

 

Open up functions.php and find a line with 'required_custom_fonts'. Add the name of your font preceded by comma.

 

2017-06-15_1547.png

 

Congratulations! Now if you go to the Appearance -> Fonts & Colors, you'll see your new typeface available among the other fonts.