I am trying to use a font I found from the internet on my website, however after many attempts it just doesn't work and the words go back to the standart "Times New Roman" font.

I have successfully installed the WP File Manager plug-in and uploaded the .ttf and .otf files of the fonts I want to use to the /assets/fonts folder of my respective [my-site]/​wp-content/​themes/[my-theme] mother folder. I then inserted the following CSS code on my site:

@font-face {
    font-family: 'Font-name';
    src: url('fonts/Font-name.otf') format('opentype'), url('fonts/Font-name.ttf') format('truetype');
font-weight: normal;
font-style: normal;

And defined the style of the text I want as

.header-logo a{font-family: 'Font-name'; color: white; font-size: 80px;}

I have also tried inserting the full path and just the font name inside url but it just goes back everytime to 'Times New Roman'.

What am I doing incorrectly here?

PS: I am not sure whether this is the accurate Stack to ask this question so I apologize if mistaken.

  • Wordpress Stack Exchange might net you the best answers! One tip I have though is to open the page in your browser's network inspector to see if the font file is being properly loaded. – Maximillian Laumeister Oct 10 '18 at 16:15
  • Sorry but programming related issues (HTML , CSS, PHP etc) is considered off-topic on Pro Webmasters. The more ideal stack is Stack Overflow but in this instance I have not migrated the question because of the lack of information provided, since its likely code that is overriding the early code which you have no provided. Please visit Stack Overflow and read through their help centre before reposting. – Simon Hayter Oct 10 '18 at 16:50
  • PS. if you link your site I might be able to tell you the problem within a couple of mins. – Simon Hayter Oct 10 '18 at 17:07