-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make fonts visible in DIVI Editor menu. #1
Comments
Sorry for the long wait! I just saw your request. 😄 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
Love the child-theme and just starting testing it.
An enhancement for the Self-hosted Fonts in DIVI would be a neat feature. (And maybe in the future download required fonts from the google-webfonts-helper API -https://github.com/majodev/google-webfonts-helper#rest-api )
I used your Child-Theme and added following PHP code in functions.php (Maybe adding a child_fonts.php file for this purpose?)
`/*Multiple Custom DIVI FONTS - Monseratt and Open sans */
add_filter('et_websafe_fonts', 'load_divi_custom_font',10,2);
function load_divi_custom_font($fonts) {
wp_enqueue_style( 'divi-child', get_stylesheet_directory_uri() . '/assets/css/fonts.css' );
// Add multiple fonts to Divi's font menu to acces them within DIVI
$custom_font = array('Montserrat' => array(
'styles' => '300,400,500,700',
'character_set' => 'latin',
'type' => 'sans-serif',
'standard' => 1
),
'Open Sans' => array(
'styles' => '400',
'character_set' => 'latin',
'type' => 'sans-serif',
'standard' => 1
));
return array_merge($custom_font,$fonts);
}`
Thanks again for a great Child Theme!
The text was updated successfully, but these errors were encountered: