Home Forums WoodMart support forum add custom font to theme option Reply To: add custom font to theme option

#27408

alizehi3d
Participant

Add a font to theme font list

Please add the following code into the end of your functions.php file:

function add_custom_font( $fonts ) {

$fonts[‘Gruppo’] = ‘Gruppo’;
return $fonts;
}

add_filter( ‘presscore_options_get_safe_fonts’, ‘add_custom_font’ ,30 , 1 );

Now This font is available in Theme Options > Typography > font list.

Note: If you want to specify font with weight you can do this using following code notation in add_custom_font() function.

$fonts[‘Gruppo:500’] = ‘Gruppo(500)’; //for 500 weight
$fonts[‘Gruppo:700’] = ‘Gruppo(700)’; //for 700 weight