Extension for Kirki that adds custom fonts to the Typography field. It works with custom fonts or Typekit fonts.
add_filter( 'vlthemes_fonts_choices', [ $this, 'kirki_fonts_choices' ] );
/**
* Add support wp-custom-fonts in Kirki
*/
public function kirki_fonts_choices( $settings = [] ) {
$fonts_list = apply_filters( 'vlthemes_fonts_list', [] );
if ( ! $fonts_list ) {
return $settings;
}
$fonts_settings = [
'fonts' => [
'google' => [],
'families' => isset( $fonts_list[ 'families' ] ) ? $fonts_list[ 'families' ] : null,
'variants' => isset( $fonts_list[ 'variants' ] ) ? $fonts_list[ 'variants' ] : null
]
];
$fonts_settings = array_merge( (array) $fonts_settings, (array) $settings );
return $fonts_settings;
}
'choices' => apply_filters(
'vlthemes_fonts_choices', [
'variant' => [
'300',
'regular',
'500',
'600',
'700',
]
]
),
include_once( PATH . 'custom-fonts.php' );
- Install Custom Fonts Plugin or Custom Typekit Fonts Plugin
- Setup your fonts
- Finally you can find your font in Kirki