Jul
30

Google Font API Thesis and WordPress

So if you keep up on these things you’ll no doubt have heard that Google has released a pretty super nifty and cool new fonts directory which will effectively allow you use some very snazzy fonts  in a very web safe way.

This makes me pretty happy since it’s always a pain to have to ignore high quality fontography in place of web safe fonts. Here’s a bit of background on the whole thing if you’ve missed it.

Google Blog Font Directory Post

Google Font Directory

Google Font Directory Preview Tool

I’m going to quickly cover how I integrated this into a WordPress theme which took all of about 5 minutes then how I integrated it into the ever popular Thesis Theme which I use on quite a number of sites which I own.

Before we dive in here are a few examples. First a non-Thesis example.

Before

screen-capture-919

After:

screen-capture-921

Non-Thesis WordPress Integration

  1. Go to The Google Font Directory Preview tool.
  2. Select your font and options.
  3. Go to your website.
  4. Crack open your header.php file.
  5. Add the following link (with the font details you’ve selected) into your file:
  6. <link  href="//fonts.googleapis.com/css?family=Cantarell:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css" >

  7. Open up your style.css file in your WordPress theme.
  8. Depending on which CSS element you are looking to replace simply comment our your current font styling.
  9. Copy Paste and replace with the Google font preview tool.

For Example:

<br />
body {<br />
margin-top: 0px;<br />
padding: 0;<br />
color: #4c4c4c;<br />
background-color: #F3ECC4;<br />
font-family: 'Cantarell', serif;<br />
font-size: 14px;<br />
font-style: normal;<br />
text-shadow: none;<br />
text-decoration: none;<br />
letter-spacing: 0.0em;<br />
word-spacing: 0.25em;<br />
line-height: 1.23em;<br />
background-image: url(images/bg.jpg);<br />
background-repeat: repeat-x;<br />
}<br />

Voila – easy as pie. You can see from the two screenshots below the difference this makes on your site. Much cleaner, more readable, and definitely more professional.

Now what about Thesis? Things are a little bit different there. So let’s dive right in – by the way, I’m not getting into the specifics of changing a CSS element in WordPress because well, this isn’t a WordPress tutorial site. I’m putting this up to be helpful.

If you’re having trouble figuring out how to change your theme CSS elements there are tons of WordPress tutorials out there that can help you out.

Thesis and Google Font Library Integration

Here’s the before of The Dusan Nedelko Foundation which is running Thesis:

Dusan Nedelko Foundation Running Thesis

And After (Ohhh, Ahhh, Ohhhh):

Dusans Website with Thesis and Google Fonts

In a similar way to a normal WordPress theme this is pretty straight forward we just want to play nice with the way Thesis handles things.

Step 1 – Add the include into the section of the theme. I’m sure there are tons of ways to do this. I actually add head elements in a slightly different way than through the Document Head section in the Thesis admin.

Open up you custom_functions.php file and add the following:

<br />
// Add the include for the Google Font API's<br />
function google_font_api() {<br />
$goog = &quot;&lt;link  href=\&quot;//fonts.googleapis.com/css?family=Reenie+Beanie:regular\&quot; rel=\&quot;stylesheet\&quot; type=\&quot;text/css\&quot; &gt;\n&quot;;<br />
$goog2 = &quot;&lt;link  href=\&quot;//fonts.googleapis.com/css?family=Crimson+Text:regular\&quot; rel=\&quot;stylesheet\&quot; type=\&quot;text/css\&quot; &gt;\n&quot;;<br />
$goog3 = &quot;&lt;link  href=\&quot;//fonts.googleapis.com/css?family=Lobster:regular\&quot; rel=\&quot;stylesheet\&quot; type=\&quot;text/css\&quot; &gt;\n&quot;;<br />
echo $goog;<br />
echo $goog2;<br />
echo $goog3;<br />
}<br />
// Add the hook<br />
add_action('wp_head','google_font_api');<br />

Obviously you need to add the include for whichever Google font you want to add. You can also feel free to copy and paste the lines from the Google Font Directory Preview tool into the Thesis Site Options->Additional Scripts section.

Same deal I just prefer to keep things tidy in my own way.

Step 2 – Add the code to your custom.css to override whichever elements you want:

To change the site title:

<br />
.custom #header {<br />
text-align:center;<br />
 font-family:'Reenie Beanie', serif;<br />
  font-size: 22px;<br />
  font-style: normal;<br />
  font-weight: 400;<br />
  text-shadow: none;<br />
  text-decoration: none;<br />
  text-transform: none;<br />
  letter-spacing: 0.015em;<br />
  word-spacing: -0.041em;<br />
  line-height: 1.23em;<br />
  text-shadow: 4px 4px 4px #aaa;<br />
  padding-top: 0em;<br />
  padding-bottom: 0em;<br />
}<br />

To change the body text:

<br />
body.custom {<br />
 font-family:'Crimson Text', serif;<br />
  font-size: 12px;<br />
  font-style: normal;<br />
  font-weight: 400;<br />
  letter-spacing: 0.015em;<br />
  word-spacing: -0.041em;<br />
  line-height: 1.23em;<br />
  }<br />

To change the sidebar headline text (this has my own custom styling in there and you can also add/remove whatever you want for style purposes):

<br />
/* Custom Widget Headers */<br />
.custom .sidebar h3{<br />
  font-family: 'Reenie Beanie', serif;<br />
  font-size: 24px;<br />
  font-style: bold;<br />
  font-weight: 400;<br />
  text-shadow: 4px 4px 4px #bbb;<br />
  text-decoration: none;<br />
  text-transform: none;<br />
  letter-spacing: 0.015em;<br />
  word-spacing: -0.041em;<br />
  line-height: 1.23em;<br />
  text-align:center;<br />
border-top:1px solid #e48902;<br />
border-bottom:1px solid #e48902;<br />
list-style:none;<br />
margin:0px;<br />
padding-top:5px;<br />
padding-bottom:5px;<br />
background:#eee;<br />
width:100%;<br />
margin-bottom:5px;<br />
color:#353535;<br />
}<br />

There you have it – as you can see below on my brother’s memorial foundation website: The Dusan Nedelko Foundation the changes make a really nice addition to the site, increasing the styling while remaining nice and simple.

Hope that was helpful and let me know if you have any thoughts, comments, rants, raves or whatever.

Pura Vida.
Danno

VN:F [1.9.11_1134]
Rating: +4 (from 4 votes)
3 Comments

Jul
25

Internet Marketing Tweet Digest 2010-07-25

Powered by Twitter Tools

VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)
0 Comments

Jul
21

The Real Life Social Network

This is a fantastic look at the real life social network and the online social network. It’s a presentation done by a Google employee and has some very interesting insights. In particular segments and groups of friends and relationships. I’ll be adding thoughts, bullet point and additional info for the post but for the time being here is the presentation.



VN:F [1.9.11_1134]
Rating: +1 (from 1 vote)
0 Comments

Jul
18

Internet Marketing Tweet Digest 2010-07-18

  • I liked a YouTube video — Sea Shepherd at Deepwater Ground Zero. ***Exclusive footage*** http://youtu.be/hV0TnjnuFww?a #
  • Mel Gibson – actual audio tape of his insane rant. Is this guy for real? http://bit.ly/aqVPla #
  • needs background Vuvuzela noise just to function properly today. It's gonna be a long wait for NFL kickoff. #
  • watching a death match between a squirrel and a Hawk outside my office window. Stupid squirrel you're gonna lose. #ilovecambridge #
  • I'm thinking I should add a few more New Orleans Saints Predictions for 2010 to my original Saints Sched/Picks post http://bit.ly/cZiW3W #
  • Just followed @wwtdd I think my chances of afterlife redemption have gone down a bit…awww screw it :) #
  • Big day – my son got his first Molar. Way to go buddy! #
  • Being forced to watch The Hills 3 hour finale. Happy wife=happy life. Help me. #
  • Watched the interview with @randfish about his building of @seomoz – congrats abd props for being so forthcoming. #
  • Good advice – how to be positive and self promote without being an annoying douchenozzle http://ow.ly/2bn20 #
  • So I own developer licenses for #thesiswp and #studiopress I feel so conflicted…nah not really…am I a derivative work? Run with it. #
  • it's more than slightly ironic that @google preaches the importance of useful <title>s yet Chrome seriously truncates them with tabs open. #
  • Do you ever write one email and feel like it's worthy of a full days worth of work. *whew* #
  • I liked a YouTube video — BREAKING THE LAW http://youtu.be/ae1cg-90Y6Q?a #
  • Haha awesome. (YouTube http://youtu.be/ae1cg-90Y6Q?a) #
  • Scientists launched a search for men who had never looked at pornography – but couldn't find any. http://bit.ly/cirSVo #
  • @aaranged haha had a good laugh when I read that one. in reply to aaranged #
  • I'm at Casa Nedelko. http://4sq.com/c40dHS #
  • Fantastic e-book about easily making money with blackhat SEO. Some great information within: http://bit.ly/9POZRH #
  • Just go to court and if in fact #thesiswp has significant copy/paste code from the core then it's a violation. Done. Enuf mud slinging. #
  • Watching some in the SEO community come off a blustering idiots is nothing new and expected #thesiswp #
  • @aaranged <meta name="more" content="beer"> in reply to aaranged #
  • @Skitzzo I listened to the call @photomatt and @pearsonified had, didn't seem like intimidation to me more like discussion just my opinion. in reply to Skitzzo #
  • @Skitzzo But I agree there needs to be resolution to it, so follow through is required. in reply to Skitzzo #
  • @Skitzzo Yeah I've seen a few, there is alot of sarcasm and reactionary comments going back and forth. On both sides. in reply to Skitzzo #
  • @Skitzzo @pearsonified made some big statements about being one of the 3 most important people in the history of #wordpress Come on srsly? in reply to Skitzzo #
  • @Skitzzo it sounded serious when @pearsonified said it. I think it's time for this to stop really…this banter is a waste of time. in reply to Skitzzo #
  • @Skitzzo Wow two people in the #wordpress and #thesiswp world agree. I'm shocked, time for cheers and beers! in reply to Skitzzo #
  • @pearsonified and @photomatt can't you see this is tearing us apart? Let's have a BBQ some beers can't we all just get along? *grin* #
  • I made $875 last week doing data entry from home! Find out how you can do the same — http://moveto.ws/y5haow0w9 Learn more! #makemoney #

Powered by Twitter Tools

VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)
0 Comments

Jul
11

Internet Marketing Tweet Digest 2010-07-11

  • @markshomezone What was what? in reply to markshomezone #
  • Some serious power outages in Toronto and area… #
  • @markshomezone haha that's Arnold in Predator at the end "Get the Chopper!" my imitation. Dead on in reply to markshomezone #
  • @markshomezone Ah that's my imitation of Arnold in the ending scene from Predator http://bit.ly/cp7aHI dead on eh? :) in reply to markshomezone #
  • So @google is going to go head to head with Facebook in the social media space. I don't know if I'd want to add another network. #
  • Thanks to the Dutch for winning today's semi in the #worldcup nailed that bet! #
  • Looks like going with the over on Minnesota at Toronto was the right way to go. #MLB #baseball #
  • Wow Jays game attendance is pretty sad. Tons of empty seats. #
  • Nice walk. Now officially nailed the over on that game #betting #baseball #MLB #
  • The Dutch world cup team didn't have hotels booked for them past July 5th even though the final is July 11 – low expectations? Oops. #
  • Where oh where are ya going? Lebron James Free Agency Odds http://bit.ly/c2vyrm #lebron #nba #
  • I think it's become pretty clear that Lindsay Lohan is a complete drug addicted idiot. Moving right along. #
  • Dear LeBron – thanks for all the trending search traffic. You're a saint. #
  • Still not sure where LeBron landed. Can't find anything on Google, Twitter of Facebook about it. Help? #
  • Google bans own Adwords help for cloaking (ironic) in other news @mattcutts must perform Hari Kari with butter knife via @honeypot_mkting #
  • Has to be Fabiano's double touch as the worst of the Five Worst Calls of the World Cup 2010 Tournament http://bit.ly/d6HV9c #
  • I never would've though that thawing fish in milk would work. Handy cooking tips from @mamahanna11 http://bit.ly/bZONNz #

Powered by Twitter Tools

VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)
0 Comments

Jul
04

Internet Marketing Tweet Digest 2010-07-04

  • I uploaded a YouTube video — Jaxie and his Puppy http://youtu.be/1yoyyJYu0CY?a #
  • The Dušan Nedelko Foundation "Disctastic Plastic Disc Golf Auction" is underway. All proceeds go to local Ontario Yout…http://lnkd.in/kJAKgz #
  • I'm at Chicopee Ski Hill (Kitchener). http://4sq.com/bApbhm #
  • I uploaded a YouTube video — Get to tha chawpa http://youtu.be/WTE8cgXb6po?a #
  • Dušan's Disctastic Disc Golf Plastic Auction Update. So far we've got almost $500 in bids. Thanks everyone and keep th…http://lnkd.in/kJAKgz #

Powered by Twitter Tools

VN:F [1.9.11_1134]
Rating: 0 (from 0 votes)
0 Comments