Tag Archives: Gravatar

Put Gravatar on

I wrote a Gravatar plugin for bbPress few days ago and I just saw Matt’s new post then, Gravatar-enabled.” It’s time to put avatars on my blog. It’s quite easy.

Where size is the size of avatar in pixel. Currently, Gravatar supports up to 80px. Soon, it will support up to 125px. The code can be done in just one line. Put it in proper place within comments loop, usually found in comments.php, and set a good style class avatar for img tag in your style.css.

If you have your own default image for commentators who haven’t used Gravatar, you can make the code as

Where $default_uri is the URI of your default image. If you default image has different size, you better to add width and height to img tag.

Design a site like this with WordPress.com
Get started