Right now "typography" font family list is returning all Google fonts but how can we add own fonts in list of font family?
(Did you try using the develop branch from github? There's a chance your issue has already been adressed there)
Latest form w.org
theme_mods
simply type "typography". i just want to add custom fonts in font family list.
You can use the kirki/fonts/standard_fonts filter for example:
function add_my_custom_font( $standard_fonts ) {
$fonts['my_custom_font'] = array(
'label' => 'My Font'
'stack' => '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',
);
return $fonts;
}
add_filter( 'kirki/fonts/standard_fonts', 'add_my_custom_font' );
Would be great if we could also control Font Variants for custom fonts like this:
function add_my_custom_font( $standard_fonts ) {
$fonts['my_custom_font'] = array(
'label' => 'My Font',
'variants' => array('300','300italic','regular','italic'),
'stack' => '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif',
);
return $fonts;
}
add_filter( 'kirki/fonts/standard_fonts', 'add_my_custom_font' );
Can't seem to be able to add available variants for my custom font either...
Fixed in 3.0
Most helpful comment
Would be great if we could also control Font Variants for custom fonts like this: