Created
August 22, 2017 23:53
-
-
Save gbissland/1d89270cd0c7c664a32316e337f32d98 to your computer and use it in GitHub Desktop.
Adding Typekit Font to Customizer in BB Theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//must first add typkit js id in page header scripts | |
add_action( 'init', 'customize_font_list' ); | |
function customize_font_list(){ | |
$custom_fonts = array( | |
'proxima-nova' => array( | |
'fallback' => 'sans-serif', | |
'weights' => array( | |
'100', | |
'300', | |
'400', | |
'700' | |
) | |
) | |
); | |
foreach($custom_fonts as $name => $settings){ | |
// Add to Theme Customizer | |
if(class_exists('FLFontFamilies') && isset(FLFontFamilies::$system)){ | |
FLFontFamilies::$system[$name] = $settings; | |
} | |
// Add to Page Builder | |
if(class_exists('FLBuilderFontFamilies') && isset(FLBuilderFontFamilies::$system)){ | |
FLBuilderFontFamilies::$system[$name] = $settings; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment