Archived topic
Adding Custom Fonts to the Theme
3 replies · Started by Kumari on May 25, 2020
Hi There
I am trying to add custom fonts to my theme.
I should mention that I am not using a child theme.
I did read and follow instructions as set out here: https://docs.generatepress.com/article/adding-local-fonts/
I am using a custom font which I've converted online:
/* font converted using font-converter.net. thank you! */
@font-face {
font-family: "Baseticatrial-Thin";
src: url("./fonts/BaseticaTrial-Thin.eot"); /* IE9 Compat Modes */
src: url("./fonts/BaseticaTrial-Thin.eot?#iefix") format("embedded-opentype"), /* IE6-IE8 */
url("./fonts/BaseticaTrial-Thin.otf") format("opentype"), /* Open Type Font */
url("./fonts/BaseticaTrial-Thin.svg") format("svg"), /* Legacy iOS */
url("./fonts/BaseticaTrial-Thin.ttf") format("truetype"), /* Safari, Android, iOS */
url("./fonts/BaseticaTrial-Thin.woff") format("woff"), /* Modern Browsers */
url("./fonts/BaseticaTrial-Thin.woff2") format("woff2"); /* Modern Browsers */
font-weight: normal;
font-style: normal;
}
I've downloaded all the font files and uploaded to:
public_html/wp-content/themes/generatepress/fonts
My question is do I use the above css from font-face and which url should I use?
Thanking you in advance
Hi there,
that CSS looks correct.
I would suggest you include the FULL URL for each of the font types.
That worked perfectly! Thank you so much
Glad to be of help