Site logo

Archived topic

Upload custom fonts

5 replies · Started by Sanu Kumar on October 25, 2020

Viewing posts 1–6 of 6

How can I install Google's "Inter" font in GP?

I added this php but "Inter" font is not showing.

add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
function tu_add_google_fonts( $fonts ) {
	$fonts[ 'zilla_slab' ] = array( 
		'name' => 'Zilla Slab',
		'variants' => array( '300', '300i', '400', '400i', '500', '500i', '600', '600i', '700', '700i' ),
		'category' => 'serif'
	);
	
	return $fonts;
}

You have to change the values in it.

Example: change $fonts[ 'zilla_slab' ] to $fonts[ 'inter' ].

also since Inter is a san-serif font, change 'category' => 'serif' to 'category' => 'sans-serif'.

You can also change what font-weights you need on the 'variants' value.

thank you Elvin

No problem. :)

This archived topic is closed to new replies.