Salutare,
I’ve uploaded my custom fonts (Open Sans Light, Regular etc – using .woff2 file types) and switched all the fonts in the Theme Panel > Theme Fonts from Default to Open Sans Light. All good on most of the elements, blocks etc BUT I still have several elements within the website that still use the default hard-coded fonts (Roboto, default Open Sans, Verdana etc) and in most cases they are loaded from fonts.google which is a BIG PROBLEM if you want to get rid of the external css/js for website optimization.
I’ve searched this forum for similar topics and I found a few answers but no actual “good” solutions to my questions below; if there is a solution please let me know:
1. If you upload a custom font and you choose it as a default Body font in Body – General Font why do I still have other fonts throughout the entire website? Isn’t the smart choice to use the font defined there as a default font for the entire website? Why use hard-coded fonts everywhere – meaning that I need to amend each and every element’s CSS to get font consistency throughout the website.
2. Is there a GLOBAL way to get rid of the default Google or hard-coded fonts for the elements that don’t have font selection options within the theme panel? I found this option but that means I need to amend the main theme and I don’t want to touch that since I’m using a child theme.
3. Is there a way to properly tap into a theme’s hook for the default fonts, to change it from a child theme? I’m asking this because in the Documentation you clearly recommend NOT to use theme’s API in a child theme. If there is a proper / secure way then please provide some insight as to how should I do it, what functions to hook to etc.
Thank you!
Hello,
Unfortunately there is no global font in our theme. The fonts are particular everywhere and they come from the theme, and from visual composer. That is the reason why we cannot use a global font as visual composer adds it;s own fonts to it’s own elements and our license agreement will not let us modify anything from the plugin.
You can try this topic to get rid of the google fonts: https://forum.tagdiv.com/topic/do-i-really-need-to-change-all-the-text-fields-for-fonts/
Unfortunately for these changes, you can only edit the main theme. sorry. There is no simple hook to use in the child theme.
Thank you!