Created
February 19, 2021 03:30
-
-
Save blogjunkie/321db0bcfa5a13355ac55583a6c86d48 to your computer and use it in GitHub Desktop.
Add custom fonts to Elementor from your theme
This file contains hidden or 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
<?php // Don't include this line | |
/** | |
* Add new font group (Custom) to the top of the list | |
*/ | |
add_filter( 'elementor/fonts/groups', function( $font_groups ) { | |
$new_font_group = array( 'custom' => __( 'Custom' ) ); | |
return array_merge( $new_font_group, $font_groups ); | |
} ); | |
/** | |
* Add fonts to the new font group | |
*/ | |
add_filter( 'elementor/fonts/additional_fonts', function( $additional_fonts ) { | |
//Font name/font group | |
$additional_fonts['MyFont Font Family Name'] = 'custom'; | |
$additional_fonts['MyFont Font Family Name2'] = 'custom'; | |
return $additional_fonts; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment