Using Gravatars in WP2.5

by frans on April 11, 2008

Edit: this site should now support gravatar images, and I recommend going to http://gravatar.com/ and registering a character/image to your email address. This helps identifying people who comment and participate in blogosphere discussions.

I have updated the software running this blog into WordPress 2.5 which brings along some nice, behind the scenes enhancements. One thing that could also show here in the user side is Gravatar support: it adds ‘global avatar’ images next to your comments automatically. But there is still something wrong with this, or I just could not get it to work. I tried editing comments.php with these sets of instructions, but I would only get empty ‘default gravatar’ images:

  • Share/Bookmark

{ 6 comments… read them below or add one }

1 Niklas Vainio April 12, 2008 at 16:49

Here you can find some code I added in my comments.php:
http://pastebin.com/m5004644

It leaves the gravatar out if there is no e-mail address defined (but not if address has been given but user hasn’t got a gravatar).

Here’s an example:
http://hiisi.fi/blog/post/2007/07/09/vihrea-primitivismi/
(a commenter has e-mail address defined but hasn’t a gravatar).

E-mail me for further help.

Reply

2 frans April 12, 2008 at 22:22

Nikke — ok, thanks. The site is now running this code, but I think I need to ask you for further advice.

Reply

3 frans April 13, 2008 at 09:23

Here is my modified (three-column Copyblogger theme) ‘comment.php’ section, with gravatar code added in:

http://pastebin.com/f42c316bf
(With syntax highlighting: http://pastebin.com/f75b88ac0)

Reply

4 Michael Aulia April 15, 2008 at 18:17

It seems to be working fine? (I can see the gravatar images)

Reply

5 frans April 15, 2008 at 21:20

Yes, I agree — lets stay with gravatars at least for a while. It is interesting to see whether people will start to use these, though. Basically this service makes it easy to see people’s faces everywhere; e.g., there is already a gravatar plug-in for Thunderbird email: https://addons.mozilla.org/en-US/thunderbird/addon/726

Reply

6 Michael Aulia April 17, 2008 at 08:02

Aww..wish there’s one for outlook and windows live mail desktop :D

Reply

Leave a Comment

Previous post:

Next post: