Archived topic
Adding custom font Geometos (otf/ttf only)
5 replies · Started by finanzbeben on March 14, 2021
Dear GP Team,
I have just followed your instructions on how to host a custom font locally.
However, it still doesn't show up in the typography/customizer. I'm not using a child theme though
I have simply added the additional CSS in the customizer (see below). What do I miss?
Many thanks in advance for your support!
/* Geometos */
@font-face {
font-family: 'Geometos';
font-style: normal;
font-weight: 400;
src: local(''),
url('XXX/wp-content/uploads/2021/03/geometos.ttf') format('truetype'), /* Safari, Android, iOS */
url('XXX/wp-content/uploads/2021/03/geometos.otf') format('opentype')
}
add_filter( 'generate_typography_default_fonts', function( $fonts ) {
$fonts[] = 'Geometos';
return $fonts;
} );
Hi there,
where did you add the code beginning with: add_filter ?
Hi David,
Thanks for your answer.
I have added this code right after the font-face code in the additional CSS box.
Kind regards
Hi there,
The add_filter() part of the code is a PHP snippet. It shouldn't be added where you've added the CSS box for font imports.
Here's how to add PHP snippets.
Here's a complete guide for adding fonts to GP:
https://docs.generatepress.com/article/adding-local-fonts/
Hi, This has worked for me - Thanks!
Nice one. Glad you got it sorted. :)