@font-face is not working in WordPress

I have a font I want to use with my links. Somehow it doesn’t work.

@font-face {
      font-family: HelveticaNeueLight;
      src: local('fonts/HelveticaNeueLight.ttf');
   }

My font path is: wp-content/themes/mytheme/fonts/HelveticaNeueLight.ttf, and I used it like this:

Read More
.jplnav li a {
     font-family: HelveticaNeueLight;
   }

Browser: Chrome

Is there some kind of special code need to make @font-face work?

Related posts

1 comment

  1. Depending on your browser and platform you need to specify the font in different formats.
    See this example:

    @font-face {
      font-family: "LeagueGothic";
      src: url('../fonts/league_gothic-webfont.eot');
      src: url('../fonts/league_gothic-webfont.eot?#iefix') format('eot'),
           url('../fonts/league_gothic-webfont.ttf') format('truetype'),
           url('../fonts/league_gothic-webfont.woff') format('woff'),
           url('../fonts/league_gothic-webfont.eot#iefix') format('embedded-opentype'),
           url('../fonts/league_gothic-webfont.svg') format('svg');
      font-weight: "normal";
      font-style: "normal";
    }
    

    If you just have the font in .ttf format and need the others, you can use the FontSquirrel’s WebFont Generator to create your own @font-face kit.

Comments are closed.