How To: Adding the Post Authors Gravatar To Their Individual Posts

One thing I am really excited about is that Gravatars are really starting to gain popularity now that Automattic has purchased and is supporting them.  And now that support is built right into WordPress, it opens up a lot of options for WordPress users.

The most common place you’ll find a Gravatar is usually with an individual comment to help comments stand out.  Another place you will sometimes see them is in the sidebar, like we have it setup here at Hack WordPress.   One thing, however, that people are slowly coming around to is using Gravatars with blog posts to identify the author of the post.    This is something that is a great idea for a multi-author blog and something I’ve considered doing on this website.

So, how would you go about setting up Gravatars to display with each individual post?   Over at ThemeShaper, Ian Stewart recently shared an easy way to do this.   You just need the following code:

<?php echo get_avatar( get_the_author_email(), '64' ); ?>

When used, WordPress will match up the e-mail address associated with the post author to determine what Gravatar to use.   The 64 is the size (pixels) of the Gravatar.

Great find Ian!

  • Leave a Comment
  • WordPress 2.5+: How To Add Gravatar to Your WordPress Theme

    As we continue to gear up for WordPress 2.5, have you gotten your theme ready for Gravatars? In the past it required plugins, but now WordPress 2.5 has built-in Gravatar support. This means going forward, themes can easily be released with Gravatars built-in to the theme because no plugin will be required.

    So, you’ve got WordPress 2.5 installed and you’re ready to assign Gravatars to your comments? All you need to do is a quick code hack to the comments loop where you want the Gravatar to show up:

    <?php if(function_exists(’get_avatar’)){ echo get_avatar($comment, ‘50’);} ?>

    I encourage everyone to support WordPress by displaying Gravatars on their blogs once you’ve upgraded to WordPress 2.5.

  • Leave a Comment
  • Support WordPress by Displaying Gravatars On Your Blog

    Do you have a Gravatar (Globally Recognized Avatar)? As a loyal fan of the WordPress software that runs each of my weblogs, I feel that it is important to support WordPress in any way that I can. Because this blog focuses on WordPress, that is especially true here.

    You may remember that last October Automattic, the company behind WordPress, purchased Gravatar. In the time since then, they have revamped the infrastructure of Gravatar to drastically speed things up, integrated it into the WordPress.com platform, and then updated the Gravatar WordPress plugin to function better with self-hosted WordPress blogs.

    If you don’t already have a Gravatar, I recommend you first sign up with Gravatar for a free account using whatever e-mail address you normally use to leave comments. Once confirmed, it will then prompt you to upload the avatar you want to use. You’ll need to use the e-mail address used for your Gravatar in the e-mail address field of the comment form (all in lower case) when leaving a comment for the Gravatar to display properly next to each comment.

    Now that Automattic is backing it, and WordPress.com blogs have integrated them, I think that over time Gravatar will continue to grow and the service will continue to get better. It is with that belief that I decided to add individual Gravatars to the comments on this blog (I also revamped the comments section to better support it). I would also like to see other self-hosted WordPress blogs begin to support Gravatars as well (many currently either support MyBlogLog avatars, or no avatars at all), so what I decided to do is update this post with an outbound link to your blog if your blog supports Gravatars.

    Here is what you need to do to get an inbound link to your homepage:

    1. Update your blog to display the commentators Gravatar with their comment. This can easily be done by installing one of the many Gravatar plugins (including the official Gravatar WordPress plugin) and then calling the plugin somewhere in your comments.php file. Depending on the theme, it will usually go in the commentblock section. If your blog already supports Gravatars, skip to step 2!
    2. Leave a comment below with a link to your blog.

    It is really that easy! I will then confirm your blog displays Gravatars with the comments and update this post with a link to your blog’s homepage, giving you a quality inbound link and hopefully some additional traffic. I’d like to turn this post into a showcase of WordPress.org blogs that support Gravatar! [Continue Reading...]

  • Leave a Comment
  • Premium Theme: WP-Magazine 1.0 WordPress Theme

    One of my favorite things about premium WordPress themes is that they give theme authors the opportunity to truly show off their talents. Because the theme will be purchased rather than given free, they don’t hold anything back and truly create some incredible work.

    Michael at Solostream is no exception. He has created a number of free themes in the past, but has since been concentrating on creating and selling a variety of premium WordPress themes for bloggers and businesses looking for a magazine-style theme.

    His most recent premium theme WP-Magazine 1.0 is his best work to date (in my opinion). Here are some screen shots of a few pages:

    WP-Magazine Screenshot

    WP-Magazine Screenshot 2

    Once purchased, you have access to five different home page layouts and four different category/archive page layouts. You can find more information about the layouts available here.

    Other features include:

    • Widget-Ready, User-Friendly, and Optimized for WordPress Versions 2.2 and Above
    • Home Page Featured Article Glider Box
    • Built-In Banner Ad Blocks
    • Built-In Site Guide in Right Sidebar
    • Customized Recent Comments in Sidebar With Gravatar Support
    • Author Biography Information and Gravatar Included on Single Post Pages
    • Alternating Color Comments With Gravatar Support
    • XHTML Valid

    In addition to these great features, this theme also supports several plugins “out of the box” including the following:

    If you’d like to view this theme in action, check out the WP-Magazine Demo Site. You can also purchase the theme from that site.

  • Leave a Comment
  • Automattic Purchases Gravatar

    It wasn’t so long ago that Gravatar was all the rage around the blogosphere. Who wouldn’t want a globally recognized avatar? But problems with the service, combined with the emergence of the popular MyBlogLog avatar, seemed to have spelled the doom of Gravatar.

    Now it looks like the service has been revived with Automattic’s recent acquisition of Gravatar. If anyone can turn this service into a success, it is the makers of WordPress. So what does this mean for Gravatar? And will the MyBlogLog avatar lose its popularity? Here is what Automattic has to say about their plans for the new service:

    • We’re going to make all of the Premium features free, and refund anyone who bought them in the last 60 days.
    • Move the gravatar serving to a Content Delivery Network so not only will they be fast, it’ll be low latency and not slow down a page load.
    • Take the million or so avatars we have on WordPress.com and make them available through the Gravatar API, to compliment the 115k already here.
    • From Gravatar, integrate them into all WordPress.com templates and bring features like multiple avatars over.
    • From WordPress.com, bring the bigger sizes (128px) over and make that available for any Gravatar. Currently Gravatars are only available up to 80px.
    • Allow Gravatar profile pages with Microformat support for things like XFN rel="me" and hCard.
    • Develop a new API that has cleaner URLs and allows Gravatars to be addressed by things like URL in addition to (or instead of) email addresses.
    • Rewrite the application itself (site.gravatar.com) to fit directly into our WordPress.com grid, for internet-scale performance and reliability.

    It looks like the main beneficiaries of this plugin will be WordPress.com users, but I would expect to see the revival of Gravatar plugins appearing on WordPress.org blogs around the blogosphere once everything gets implemented.

  • Leave a Comment