Replace Your Default Gravatar With Some Meaningful Images

You may want to read our latest article Best posts on Bloghonour from Dec 2008

Gravatar stands for Globally Recognize Avatar. It is basically an image following you from weblog to weblog as long as you use the same email address to comment.

Before Wordpress 2.5, you need to install plugin in order to use Gravatar in your blog. But after Wordpress acquired Gravatar and released Wordpress 2.5, Gravatar became an inbuilt feature.

To use Gravatar, you simply call this:

<?php echo get_avatar( $comment, 50 ); ?>

But, do you know that you can replace the default avatar with a more meaningful image? Actually, Gravatar supports Identicons, MonsterID, and Wavatars. You may set your default avatar to use one of them. So, if your reader doesn’t has a gravatar account, the system will automatic generates an image for him.

Below are some examples of using Identicons, MonsterID, and Wavatars as your default gravatar:

<?php echo get_avatar( $comment, 50, $default = 'identicon ' ); ?>
<?php echo get_avatar( $comment, 50, $default = 'monsterid ' ); ?>
<?php echo get_avatar( $comment, 50, $default = 'wavatar' ); ?>

The output avatar is depends on the commenter’s email address. So, the same commenter will always get the same avatar image.

I had set the default Gravatar to use Wavatars so now each of my commenter will have hos own unique avatar.

Tags: , , ,

You may be interested in reading these articles

1 Comment so far...

  1. kavin

    let me have a try :)

1 Trackback

  1. Geek Week - This week jQuery tutorials, CSS3, & WordPress - PHP, XHTML, Web Design, Flash | JasonCypret.com

Leave a Reply