O'Reilly logo

WordPress 2.8 Themes Cookbook by Lee Jordan, Nick Ohrn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing the default Gravatar icon for your theme

A great way to build a community around a blog is to allow the users to personally identify themselves, either as authors or when commenting. Luckily, WordPress has built-in support for user avatars, by using the Gravatar service. Unfortunately, not all users have registered their e-mail address with Gravatar.com and they get stuck with a boring mystery man outline.

Luckily, WordPress allows administrators to change the default Gravatar for users who don't have them, and allows theme authors to provide custom defaults when their theme is active.

Getting started

You need to have created a WordPress theme containing at least a style.css file and an index.php file. Also, you should be using the get_avatar ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required