My Apologies, Comments Are Disabled on This Post
Apparently using Adobe Fonts in a heading leads to a lot of spam. As a result, I have had to disable comment on this post.
GeneratePress is a great WordPress theme, and its blocks are super powerful, albeit incredibly simple.
While developing a site, I wanted to use Adobe Fonts with the GeneratePress customizer. I use the following plugin:
Here is the code I used to add Adobe Fonts to the GeneratePress customizer.
/**
* Compatibility with: https://wordpress.org/plugins/custom-typekit-fonts/
* Would be nice to be able to categorize fonts: https://docs.generatepress.com/article/generate_typography_default_fonts/
*/
add_filter( 'generate_typography_default_fonts', 'mr_custom_add_typekit_fonts' );
function mr_custom_add_typekit_fonts( $fonts ) {
// Add Typekit Fonts.
if ( defined( 'CUSTOM_TYPEKIT_FONTS_FILE' ) ) {
$adobe_fonts = get_option( 'custom-typekit-fonts', array() );
if ( isset( $adobe_fonts['custom-typekit-font-details'] ) ) {
foreach ( $adobe_fonts['custom-typekit-font-details'] as $font_name => $font_details ) {
$fonts[] = $font_name;
}
}
}
return $fonts;
}
Code language: PHP (php)