Site logo

Archived topic

Adding additional google fonts to the customizer

7 replies · Started by mavrocreative on May 28, 2019

Viewing posts 1–8 of 8

Hi there!

What's the easiest/best way to add a google font to the customizer if it's not already listed?

Thanks!

Donna

Thank you so much! Where do I find the information to include such as the variants and array?

Donna

HI Leo, thank you!

Sorry for the confusion! I know how to add PHP; I wanted to know where do I find the Google Font values for variants, etc. as seen in this example:

add_filter( 'generate_typography_customize_list', 'tu_add_google_fonts' );
function tu_add_google_fonts( $fonts ) {
$fonts[ 'david_libre' ] = array(
'name' => 'David Libre',
'variants' => array( '400', '500', '700' ),
'category' => 'serif'
);

Donna

return $fonts;
}

Thank you so much!

No problem :)

This archived topic is closed to new replies.