Skip to content
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

Open
beckbeck-se opened this issue Sep 22, 2022 · 1 comment
Open

Make fonts visible in DIVI Editor menu. #1

beckbeck-se opened this issue Sep 22, 2022 · 1 comment

Comments

@beckbeck-se
Copy link

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!

@mirkoschubert
Copy link
Owner

Sorry for the long wait! I just saw your request. 😄
This is a good idea. Since I'm working on a plugin for the Oxygen builder with this feature, I guess I could implement a similar solution for my Divi child theme.
Stay tuned for the next major update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants