How To Use Google Web Fonts on WordPress and Other Sites
Earlier this week Google released Google Font Directory and Google Font API. Google teamed up with Typekit to create an open sourced Font project. All fonts found in the directory are available for use on any website under an open source license and are served by Google servers. Once in the directory, you can browse Google’s catalog of fonts, learn more about the font designers and get the code required to use them on your site.
Google Web fonts is compatible with the following browsers
- Google Chrome: version 4.249.4+
- Mozilla Firefox: version: 3.5+
- Apple Safari: version 3.1+
- Microsoft Internet Explorer: version 6+
How to Add Google Web Fonts to a Website
To use Google Web Fonts on a website is easy. Just add the link to the style sheet that links to the Google servers inside your head tags.
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=fontname">
Then add the CSS in between the style tags and add to whatever selector you want.
Code Example: There two way to use Google API
Here’s an example. You can copy and paste the following HTML code into the index.html.
Option 1:
body {
font-family: 'Tangerine', serif;
font-size: 48px;
}
Option 2:
<div style="font-family: 'Font Name',serif;">Your text</div>
Here’s an example. You can copy and paste the following HTML into an index.html.
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
<style>
body {
font-family: 'Tangerine', serif;
font-size: 48px;
}
</style>
<h1>Making the Web Beautiful!</h1>
Making the Web Beautiful!
How to Add Google Web Fonts to a WordPress Blog
As of right now, there are not any plugins that will allow us to simply choose and add an entry into post or restyle the fonts on your site. After some research and testing I was able to use Google Fonts API. I have only figured how to use Google Fonts by adding an entry in the CSS, so the overall fonts will change. I am still looking into how change the font when using the editor.
In order use Google fonts, all you need to do is update your header.php file and style.css. For this example, I changed the H tag. I changed the H5 tag because I rarely use that h tag.
NOTE: Before you make any changes to these files, back them up and save a copy on your computer.
First thing you will need to do is chose what font you want to use. Then open your header.php file. Appearance >> Editor >> Header.PHP. Inside your head tags, add the following code:
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=fontname">
For our example I am using the Tangerine font. So I used the below code.
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Tangerine">
After entering your code, click on update file.
Next, you will need to open the style.css file. Once opened, you can then add the CSS to whatever element you want. Just copy and paste this code in your style sheet. Once the code is added then click update file.
CSS selector {
font-family: 'Font Name', serif;
}
In our example, I made the change to the H5 tag. To make that change you will need to look at the code and find how the H5 is coded and make the necessary changes. The code I used is:
h5{font-family: 'Tangerine', serif;font-size: 48px;text-shadow: 4px 4px 4px #aaa;}
Evolutionary Designs
NOTE: text-shadow: 4px 4px #aaa; is adding a shadow, and is not needed. I added this because the font looks good with a drop shadow.
That’s it. There nothing else to it. If anyone can figure out how to manually style certain lines in a post entry, please let me know. If you come across any plugins that can make this easier for those that do not want manually code this, please tell us where to find it.

You Might Be Interested In :

| Print article | This entry was posted by James on May 20, 2010 at 8:20 pm, and is filed under tutorials. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
- Element321
- Vote on this article at blogengage.com
- Featured in MMO Social Network
- Famous Bloggers
- DesignGizer
- Tweets that mention How To Use Google Web Fonts on WordPress and Other Sites | Evolutionary Designs — Topsy.com
- Heather in BC
- The Tweek List, 5-21
- You are now listed on FAQPAL
- dagaloo.com
- designfloat.com
- Jose Luis delaCámara
- Zachary Zorbas
- Zachary Zorbas
- Oleg Xtraboy
- Toma Shuji
- Michelle













about 1 year ago
Thanks for explaining about the fonts – I saw an example on another blog today and wondered how it was done
My recent post Summer Nights Aboard Yacht in Vancouver
about 1 year ago
Hi,
I wanted to let you know about my new Google Fonts WordPress Plugin. I hope you like it. It's simple, but will be expanded greatly in the future. -http://easywebcoder.com/wordpress-plugins/google-…
Any feedback is welcome.
Jeff
about 1 year ago
Jeff, looks like we are working on similar projects! Greetings. Here's another plugin for adding Google Fonts to your WordPress site:
http://adrian3.com/projects/wordpress-plugins/wor…
Just select the font you want to use from a dropdown and optionally assign it to standard elements like headlines, lists, blockquotes, etc.
about 1 year ago
i love the way google always surprises us with their new invention.
My recent post 30 Sales Tags Vector Graphics
about 1 year ago
yeah, I love these new changes. I haven’t had chance to really use these fonts, but I have seen several sites using it…
James recently posted..Back-End Solutions to Having a Quick Load-Time
about 1 year ago
Thanks for another fantastic article. I am always looking for original WordPress tutorials to suggest to my own readers. Thanks for creating this post. It’s just what I was trying to find. Truly phenomenal post.
about 1 year ago
Thanks Carol for stopping by and commenting.
I try and add new wordpress tuts when I have time to work through them on this site or my test servers.
James recently posted..Guest Post- How Simple Comments can Build High Traffic Sites
about 8 months ago
Thanks for a great article explaining about the fonts – I am going to use it for my new WordPress blog and in the logo
http://www.datacentredesign.co/hvac-index.php