• Is there any way to add to the supplied fonts, I see they are stored as woff2 file sin the theme fonts subdirectory.

    I’ve attempted to create a new folder , upload my woff2 files and added appropriate sections to the .css file but my addition is not getting slurped up by the WPTT_WebFont_Loader() function

Viewing 1 replies (of 1 total)
  • Theme Author uxl

    (@uxl)

    The supplied fonts in the theme are defined in the theme.json file, and also in the hansen_fonts_url() php function in the functions.php file.

    To add to these fonts you could create a child theme containing it’s own theme.json file with your fonts added in the settings > typography > fontFamilies array.

    In the functions.php file of your child theme, you would need to enqueue the fonts by writing a function similar to the hansen_fonts_url() and using the wp_enqueue_scripts and enqueue_block_editor_assets actions to make the fonts available available in the front end of your site and the editor.

    There is work underway to make it possible for users to add their own fonts in the Site Editor but it is not available in WordPress just yet.

    Do you have a lot of fonts you want to add? If there is only a couple or so, we could maybe look at adding them to the theme, so long as they are GPL license compatible.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding Custom Fonts’ is closed to new replies.