• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

Nile Flores Media

Helping You Rock Out Your Website Like A Rockstar

  • Home
  • About
  • Blog
  • Portfolio
  • Hire Me
  • Resources
  • Contact
  • Blogging
  • WordPress
  • Social Media
  • SEO
  • Web Design
  • News
  • Podcast
You are here: Home » WordPress » Implementing Fonts in WordPress Using the @font-face Method

Implementing Fonts in WordPress Using the @font-face Method

By Nile Flores 12 Comments


fontface-plus-wp-thumbnailI’m a stickler for telling people to stop using Google Fonts. Everyone knows that some services of Google have been slow or down at times. It’s not often, but it is an annoyance because the end user can’t do anything. Most web hosts allow you to host your fonts in house, so why not do that.

As long as you’re keeping within the license of the font, you are fine. In fact, FontSquirrel.com has a ton of fonts and the ability to generate a font kit so you can implement the fonts via CSS using the @font-face method.

This article will show you step by step on how to get the font, load it up, and then implement it into your WordPress theme’s stylesheet.

Implementing Fonts in WordPress Using the @font-face Method

1. Choose your font. If you’re using FontSquirrel.com, just pick a font that you like. Some fonts come available with a Webfont kit. Others, you may have to download the Open Type or True Type font, and then load it to the Webfont Generator.

fontsquirrel-individualfont-screenshot

fontsquirrel-webfontgenerator-screenshot

Download the file to your computer

2. Unzip the files.

3. Load only the files with .eot, .ttf, .svg, and .woff to your theme. You might want to name a directory as ‘font’, to load all your fonts to it.

4. Open the stylesheet (style.css) that was in your zip file. Copy the code. It will look something like the following code:

@font-face {
    font-family: 'diavlobold';
    src: url('diavlo_bold_ii-webfont.eot');
    src: url('diavlo_bold_ii-webfont.eot?#iefix') format('embedded-opentype'),
         url('diavlo_bold_ii-webfont.woff') format('woff'),
         url('diavlo_bold_ii-webfont.ttf') format('truetype'),
         url('diavlo_bold_ii-webfont.svg#diavlobold') format('svg');
    font-weight: normal;
    font-style: normal;

}

5. Open up your theme’s stylesheet (also style.css), and paste your @font-face CSS. You may want to label it. You will need to add the correct path to your font like the example below.

/* Import Fonts
------------------------------------------------------------ */

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

}

6. Adjust the CSS in your theme’s stylesheet to the font family you desire. For example, if you want all the headings to have the custom font you uploaded, you would do the following:

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: 'diavlobold', arial, serif;	
}

Please note that the font listed on the line for font-family in step 5 is the one that you want to use. Also, note that there are other fonts listed after. These are fonts to fall back on just in case the font fails or the file becomes corrupted. It’s always good to have a couple listed.

You can use several fonts using the @font-face method. However, use them at your own discretion, and choose fonts that are easy to read, especially for the content areas on your website.

In the case you don’t want to fool with much code in WordPress, you can install the WP font-face plugin and it will work in a similar manner. This plugin will allow you to select the font in the styles dropdown in the TinyMCE editor.

Do you use custom fonts on your site? What method do you use?


Filed Under: WordPress Tagged With: @font-face, css, custom font, webfont

About Nile Flores

Nile is a 43-year old female from the greater St. Louis (Southern Illinois side) area. Nile is a mother of 1 son. She is also a web designer and developer, a graphic designer, and a public speaker, who exclusively designs and develops using WordPress. She also blogs at GoDaddy's Blog, Verpex Hosting's blog and her very personal sites, Pixelled and Nail Polish Happy.




Related posts:

No related posts.

Reader Interactions

Comments

  1. Jakes says

    April 14, 2014 at 1:40 am

    Nice tip. I have never used Google fonts on wordpress blogs, though I was using Google fonts on some static sites. I guess now I have to give it a rethink. Somehow, I never thought it could make it slow or it can even be down at times. I have never tried fontsquirrel. I better make use of these tips from you.

    –
    Jakes

    Reply
  2. Kaloyan Banev says

    April 14, 2014 at 5:38 am

    This method offer some benefits, especially if there are conflicts with caching plugins.

    Reply
  3. Troy S. says

    April 15, 2014 at 2:58 pm

    Wait. What? I had NO idea I could do this. Guess I never really thought about it but is amazing I can change the font. Wow! I went to Font Squirrel and they have a couple nice script fonts there. Very cool. Thank you so much for writing about this. It is certainly like a Eureka moment. LOL

    Reply
    • Nile says

      June 13, 2014 at 4:18 pm

      Glad I could help, Troy. 🙂

      Reply
  4. I. C. Daniel says

    April 16, 2014 at 4:21 am

    Thanks for CSS lesson darling.

    Reply
  5. Jijin Mohan says

    April 19, 2014 at 7:54 am

    I never know about this. Thanks for the lesson. This will be beneficial for beginners like me. You are amazing Nile…

    Reply
  6. Marquita Herald says

    April 19, 2014 at 1:09 pm

    A bit advanced for me, had to read it a couple of times to let it sink it, but I’m definitely intrigued and think I’ll take a closer look at this option. Thanks for the tip and directions Nile!

    Reply
  7. Jawad Zaib says

    April 20, 2014 at 1:08 pm

    For me its a little bit of advance stuff as i am not a technical guy,,,WordPress is a great cms for guys like me who want to concentrate only on our writings thanks for this nice article,,,nice learning article for those who want to learn some new stuff…

    Reply
  8. Marty Diamond says

    April 20, 2014 at 7:22 pm

    I’ve used Google Fonts in the past – always made sure thought that I had some alternatives listed – however down time & slowness would be a big knockout – I’ll check out Font Face

    Reply
  9. Rachel Lavern says

    April 28, 2014 at 11:47 am

    I love using fantastic fonts to use on my sites. One of my blogs uses Thesis premium website framework to support the Google Font Directory, and I wonder if they are slowing down my site. I always thought that their fonts were served directly from Google servers, so everyone can see the fonts no matter what browser or operating system they have.

    Reply
  10. Dawn Golden says

    May 14, 2014 at 8:59 pm

    I agree with Jawad… much of the technical stuff makes me cry! (He didn’t actually say that it made HIM cry!) I would say my fonts are a little wonky at the moment since the last WP update, so I wish I did understand it all more.

    Reply
  11. hiren says

    May 31, 2014 at 8:29 am

    Hi Nile
    helpful article thanks for sharing css example.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Follow Me On:

  • Facebook
  • Instagram
  • LinkedIn
  • Twitter
  • YouTube

Get The Latest WordPress & Blogging Tips

Sign up for my newsletter, and also get my free ebook on 10 Reasons Why Your Website Isn't Converting, and How to Fix it!




Try to be More Positive on Social Media

Note: You can click on image and view the video in a larger lightbox window.

Footer

The Blog

Lots of free information, tutorials, and more to help you bring your best foot forward with your website.

  • Blogging
  • WordPress
  • Social Media
  • SEO
  • Web Design

Get The Latest WordPress & Blogging Tips

Sign up for my newsletter, and also get my free ebook on 10 Reasons Why Your Website Isn't Converting, and How to Fix it!

Copyright © 2025 · · WordPress