How to Add a New Font to the Fortunio Theme
Fortunio theme includes a collection of Google Fonts, which you can find in Appearance -> Fonts and colors -> Fonts.
However the list of available fonts can be expanded by adding new ones.
Adding a New Google Font
- 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.
- 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:
- Save the changes.
Now your new font is available in the font settings for all typography elements.
Adding a Custom Font
- In the css/font-face/ directory, create a new folder and give it a name of your font.
- The folder has to contain a @font-face kit, which would load your custom font on a webpage.
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.
- 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.
Congratulations! Now if you go to the Appearance -> Fonts & Colors, you'll see your new typeface available among the other fonts.
Note: We recommend using child themes when making adjustments to the core theme files. If you decide to use a child theme, copy the edited files into the child theme folder, preserving the original folder structure.