How do I add a font to the Divi wordPress theme? The font is from fonts.com and is called Vectora. Should I use a plugin or custom code? The site I would like to add it to is stewards.degrootdesign.com
How do I add a font to the Divi wordPress theme? The font is from fonts.com and is called Vectora. Should I use a plugin or custom code? The site I would like to add it to is stewards.degrootdesign.com
4
Answers
Divi is a commercial WordPress theme that not everyone has access to, so we don’t know the particulars of how the theme is designed; so this is the wrong place to ask, and you should to ask Divi theme support for help. You bought the theme, and support is included in the cost.
Their advice will probably include making a child theme; see Child Themes « WordPress Codex. And/or possibly a plugin to make CSS (and font) changes easy, such as https://wordpress.org/plugins/simple-custom-css/
(Assuming that you have the latest version update of Divi):
Go to Appearance -> Customize -> General Settings -> Typography
You should see what is in the screenshot below. From there you can change the header and body font
🙂 Hope this helps
Screenshot for Typography
Late answer – but I’ll bet it’s helpful to someone as i still couldn’t find an answer to this anywhere today:
To add a custom font to the Divi theme (i’m on V3) font selector dropdowns, you’ll need to follow the following steps:
Add your webfont folder to the Divi theme folder eg:
Divi/webfonts
Then reference it from header.php before the closing head tag eg:
Now, in both: themes/Divi/includes/builder/core.php and themes/Divi/epanel/custom_functions.php
– find the following line:
and add your font after it, as per the other fonts listed – eg:
This worked a charm for me. The font should be usable and also should appear in the Font selection dropdowns in the Divi Editor with the other google fonts.
Note: I know this should be done via a child theme and will be overwritten with a Divi theme update but my php and wordpress-fu is too poor to work out how to manage this just yet.
Best approach to override the function in child theme by simply adding this code in child theme and your font will be appear in Divi theme editor.