One of our WP Pro Business clients recently went through a redesign in anticipation for her book release. We moved her to the Genesis framework and implemented a customized version of the Crystal child theme.
She needed custom fonts on her site in order to match the design of her book cover. Here’s how we accomplished that goal.
The Goal
The original font for the site title and other areas being used was Arial, we needed to change that to the Typewriter Royal 200 web font provided by FontsForWeb.com.
Here’s the title before:

Before
Here’s the title after:

After
Setting Up the Change
FontsForWeb.com provides you with code that calls their font and it’s included CSS class. It’s required that you put this code into the header of your document.
<pre><style type="text/css">
@font-face{
font-family: "typewriterroyal200bold";
src: url('http://fontsforweb.com/public/fonts/801/typewriterroyal200bold.eot');
src: local("Typewriter Royal 200"), url('http://fontsforweb.com/public/fonts/801/typewriterroyal200bold.ttf') format("truetype");
}
.fontsforweb_fontid_801 {
font-family: "typewriterroyal200bold";
}
</style>
How To Include Header Scripts in Genesis?
Genesis makes it super easy and there are several ways to do it. We chose to simply include this script in the Genesis Header/Footer Scripts section of the Genesis Theme Settings.
- Navigate to Genesis–>Theme Settings
- Scroll down and on the bottom right you will see the Header/Footer Scripts section
- Insert the FontsForWeb.com script
- Choose Save Settings
The Header/Footer Scripts section should look like this:
Note: Google also provides web fonts and this should work for them as well.
Filtering to Access CSS Font Styles
We had to include two functions in order to filter the CSS output of the site title and post titles in our Genesis child theme. We did this in order to include the fontsforweb CSS classes so we could style them accordingly.
We included the two functions below in our Crystal child theme’s functions.php file.
Our Function to Filter the Site Title
//Filter Site Title to Add Font Class
add_filter('genesis_seo_title', 'fontforweb_genesis_seo_title', 10, 3);
function fontforweb_genesis_seo_title($title, $inside, $wrap) {
return sprintf('<%s id="title">%s</%s>', $wrap, $inside, $wrap);
}
Our Function to Filter the Post Titles
//Filter Post Title to Add Font Class
add_filter('genesis_post_title_output', 'fontforweb_post_title_output');
function fontforweb_post_title_output( $title ) {
return sprintf( '<h2>%s</h2>', apply_filters( 'genesis_post_title_text', get_the_title() ) );
}
CSS Edits
We could have targeted the new
.fontsforweb_fontid_801
CSS class in the style.css file in our child theme , but because all we needed to define in our case was the actual font, that was already taken care of in the code we added to the Header/Footer section above.
Please Leave Us a Comment if You Found This Useful
Enter Our Ultimate WordPress Giveaway Now
There are over two dozen more premium WordPress plugins, themes, and online business tools up for grabs right here!












Learn: How I Added Custom Web Fonts to Genesis Child Theme http://wpmodder.com/how-i-added-custom-web-fonts-to-genesis-child-theme-1184.html
RT @wpmodder: How I Added Custom Web Fonts to Genesis Child Theme #wordpress http://tiny.ly/XfUe
How I Added Custom Web Fonts to Genesis Child Theme #WordPress http://tiny.ly/K0Xz
How did you decide to go with fontsforweb.com? I have been using Typekit but would like to have more options.
Hi Dorian,
My client decided for me. I had never header of fontsforweb before, but then again, I wasn’t looking either. I have been following Google Web Fonts for awhile now and they seem to have regular additions too.
Thanks for taking the time leave a comment:)
Ah! I haven’t looked into Google Web Fonts – will have to check that out. I also saw that fonts.com now offers web fonts, and I know they have a very extensive selection. Trying to decide if I want to shell out for that, too, or just stick with Typekit. http://webfonts.fonts.com/
Commenting on Google Web Fonts. Am curently using them in a Geneiss Child theme of my own making that features Google fonts from the collection. Couldn’t have been easier. Just add the required code to the header box mentioned above and style the CSS using the font name and style you mentioned.
Adding a font outside the Web Font collection is possible using the API but I haven’t gone there yet…
Hi there,
You could simply use “Font” plugin for wordpress to achieve same thing as you’ve described
http://wordpress.org/extend/plugins/font/
After installing pluing go to
Appearance->Fonts
and select font which you like. Much simpler.
Hi Pawel,
Thanks for the comment, always nice to hear from a plugin developer:) It’s true that your plugin for FontsForWeb is very useful. I would recommend it to anyone reading this.
However, the reason I went with the method I did was because your plugin didn’t affect the nav menu or widget titles (both visual options we decided not to use in the end).
I’ll be writing up another article here in a couple days detailing how I changed the nav menu and widget title fonts.
As I said, you’re plugin is awesome and very useful, we just decided to go another route with this one.