Dreevoo.com | Online Learning and Knowledge Sharing
 
Home | Programs | Web services | Web sites | Change font to custom @font-face on Wordpress
Guest
Click to view your profile
Topics
Programs
Languages
Recipes
Home
Shortcuts
 
 

Change font to custom @font-face on Wordpress

Last time we created a @font-face kit with an online @font-face generator, this time we will put a no-web font to a Wordpress site.

 
  Author: mat | Version: | 15th July 2012 |  
 
 
1.
 

I want to change this plain old boring font for my vertical menu to something more funky.

Click here to find out how to create a @font-face kit for a custom non-web font.

 
 
2.
 

Now upload the fonts (files with .eot, .svg, .ttf, .woff extensions) via ftp ...

Click here to find out how to use the FileZilla ftp client for transferring files from or to a website.

 
 
3.
 

... into the home folder of the theme you are using on Wordpress.

I'm using a theme called solo so I uploaded the font files into /wp-content/themes/solo folder on my Wordpress web server.

Click here to find out how to upload files via ftp client.

 
 
4.
 

We need to edit the style.css.

Style.css is also in the theme home folder. You can download it again via ftp and edit it on your computer. It's always a good idea to backup or rename the style.css file before you changing it.

 
 
5.
 

Open style.css in a text editor.

You can use Dreamweaver or some other text/code editing software. Try out Notepad++ it's pretty awesome and free.

Put the following lines somewhere at the beginning of the code:

@font-face{
    font-family: 'suplexmentary_comic_nc-webfont';
    src: url('suplexmentary_comic_nc-webfont.eot');
    src: url('suplexmentary_comic_nc-webfont.eot?#iefix') format('embedded-opentype'),
    url('suplexmentary_comic_nc-webfont.woff') format('woff'),
    url('suplexmentary_comic_nc-webfont.ttf') format('truetype'),
    url('suplexmentary_comic_nc-webfont.svg#webfont') format('svg');
 }


In your case it's going to be some other font, so instead of suplexmentary_comic_nc-webfont, you must put the name of your own font. The easiest way is to open the stylesheet.css that came with your @font-face kit and copy/paste the lines to style.css. Don't forget the closing bracket }.

 
 
6.
 

Now we need to change the font of the text on the website. All you need to do now is to find your style settings of the div or the part of your homepage where you want to change the font and enter font-family of your new custom font:

font-family: suplexmentary_comic_nc-webfont;

suplexmentary_comic_nc-webfont is going to be something else in your case.

Save all the files you changed.




 
 
7.
 

And upload them to a website server on the same location you downloaded them from.

 
 
8.
 

And if everything went according to a plan, when you refresh your website, you should be able to see your new fonts.

 
 
 
   
  Please login to post a comment
   
 
 
online learning made for people
Dreevoo.com | CONTRIBUTE | FORUM | INFO