- This topic has 11 replies, 4 voices, and was last updated 1 year, 2 months ago by David.
-
AuthorPosts
-
June 18, 2020 at 2:48 am #1332361Elia
Hi there, the “Inter” google font is missing in your theme. Could you please fix this?
June 18, 2020 at 2:52 am #1332370DavidStaffCustomer SupportHi there,
GP only displays the top 200 google fonts to keep the customizer running smoothly. You can selectively add fonts using the snippet provided here:
June 18, 2020 at 3:04 am #1332391EliaThanks a lot, David!
I’m adding this code and I don’t see the font in the list:
add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' ); function tu_add_google_fonts( $fonts ) { $fonts[ 'inter' ] = array( 'name' => 'inter', 'variants' => array( '400', '700' ), 'category' => 'serif' ); return $fonts;}
Am I missing something?
June 18, 2020 at 3:18 am #1332420DavidStaffCustomer SupportTry this:
add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' ); function tu_add_google_fonts( $fonts ) { $fonts[ 'Inter' ] = array( 'name' => 'Inter', 'category' => 'serif' ); return $fonts; }
There are no varients as such with Inter as its a fancy variable font.
June 18, 2020 at 4:06 am #1332487EliaThanks a lot, David!
June 18, 2020 at 6:25 am #1332603DavidStaffCustomer SupportYou’re welcome.
January 27, 2022 at 9:01 am #2096026teloyrurHi!
I’ve just tried to use this as a template for adding Carrois Gothic SC but it’s not showing up in my list.
As I’ve no idea what I’m doing with CSS I just added what I thought might work to the current CSS in my child theme, so the whole thing looks like this now:
.site-branding { display: inline-block; vertical-align: middle; } .site-logo { float: right; } add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' ); function tu_add_google_fonts( $fonts ) { $fonts[ 'Carrois Gothic SC' ] = array( 'name' => 'Carrois Gothic SC', 'category' => 'sans-serif' ); return $fonts; }
January 27, 2022 at 9:06 am #2096029DavidStaffCustomer SupportHi there,
that code is not CSS – its PHP. This article explains how to add it to a site:
https://docs.generatepress.com/article/adding-php/
Please note – if you’re using the new Dynamic Typography option ( see here ) its not required. If that leaves you a little lost then raise a new topic and we can take a look.
January 27, 2022 at 9:40 am #2096078teloyrurThanks David!
I’m totally lost!
I’ll start a new topic.
January 27, 2022 at 10:02 am #2096113DavidStaffCustomer SupportWe’ll look out for it 🙂
February 14, 2023 at 2:36 am #2532611AlexanderHi David,
Is this still the way to do this (as Inter still does not show up in my list of Google fonts under Customize > Typography)?
add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' ); function tu_add_google_fonts( $fonts ) { $fonts[ 'Inter' ] = array( 'name' => 'Inter', 'category' => 'serif' ); return $fonts; }
Thanks,
AlexFebruary 14, 2023 at 4:40 am #2532725DavidStaffCustomer SupportHi there,
if you switch to Dynamic Typography then that will have the Inter font listed:
https://docs.generatepress.com/article/switching-to-dynamic-typography/
-
AuthorPosts
- You must be logged in to reply to this topic.