Diana
Diana

Reputation: 213

How to add a new font to WordPress?

I want to use a specific font on a website. I don't want to use any type of plugin, and the font I want, I don't find it free to add through a link, so I have decided with the @font-face method

1 - I add the following code to the styles.css file:

@font-face {
    font-family: university-roman;
    src: url(https://myWebsite.com/wp-content/themes/my-Theme/fonts/university-roman.otf);
    font-weight: normal;
}

2 - I have created the fonts folder in the following path of my directories:

wp-content/themes/my-Theme/fonts/university-roman.otf

3 - I have added the css corresponding to the text where I want to add the new fonts:

.site-title-main {
font-family: "university-roman", Arial, sans-serif;
}

But the text does not display the University fonts.

What am I doing wrong ?

How can I make the new fonts work?

I hope I have described the problem that I cannot solve.

Thank you

Upvotes: 2

Views: 587

Answers (1)

Che Shy
Che Shy

Reputation: 21

In your @font-face css declaration. An e is missing in your path /my-Them/ should be /my-Theme/ isn't it?

Upvotes: 1

Related Questions