Dear Customers! We're out of the office from the 6th of October to the 11th of October. We sincerely apologize for the inconvenience. For WordPress 5.5.* related issues, please visit this article.
Is it possible to add custom fonts to a child theme and make them available in the theme settings drop-down menus? I would anticipate that the theme files would be uploaded to the child theme folder on the server, would be added to the child theme CSS file via a @font-face declaration, but what needs to be included in the child theme functions.php file to add the custom font to the list?
Something like:
function wp_add_custom_fonts() {
return array( 'My Custom Font' ); // Add font to array
}
I'm sorry but adding a custom font to the dropdown menu is not possible out of the box. However, it is of course possible to add a custom font via a Child Theme.
To disable the default, parent theme font loading (we don't want to slow down the website), please use this code (add it to functions.php file of the Child Theme):
function engage_fonts() {
return true;
}
After that, upload the font files to the child theme (create a new folder for them, like /engage-child/assets/fonts/) and then you may import them directly in the child's style.css, like:
Is it possible to add custom fonts to a child theme and make them available in the theme settings drop-down menus? I would anticipate that the theme files would be uploaded to the child theme folder on the server, would be added to the child theme CSS file via a @font-face declaration, but what needs to be included in the child theme functions.php file to add the custom font to the list?
Something like:
Does the function already exist to do this?
Hello there!
I'm sorry but adding a custom font to the dropdown menu is not possible out of the box. However, it is of course possible to add a custom font via a Child Theme.
To disable the default, parent theme font loading (we don't want to slow down the website), please use this code (add it to functions.php file of the Child Theme):
After that, upload the font files to the child theme (create a new folder for them, like /engage-child/assets/fonts/) and then you may import them directly in the child's style.css, like:
So, actually, after disabling the default font loading from the Theme Options panel, you just add a custom font via the child theme the standard way.
Kind Regards,
Veented Team