Create a Custom Default Avatar

Create a Custom Default Avatar

What, custom default?! I mean the avatar that is displayed next to peoples’ comments when they don’t have a custom one offered by Gravatar. In this case the famous Mystery Man, the Gravatar logo or some other options (WP Admin > Settings > Discussion) will be displayed.

You probably already know how simple it is to add gravatars to your blog:

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

32 is the pixel size of the avatar. Of course you can change that to your needs.

To get rid of the Mystery Man just add another argument to the above-mentioned function:

<?php echo get_avatar( $comment, 32, 'url-to-your-custom-avatar.gif' ); ?>

Try it out! It’s really simple. :-)

For more Information see also WordPress Codex.

Tags: , ,

Ähnliche Artikel

Hat Dir der Artikel gefallen?

3 Kommentare zu Create a Custom Default Avatar

Designaholic
7. November 2008

Sweet tip dude, nice clean blog too!

kami
6. November 2008

How do I upload a photo of myself to be used as my avator when I post comments on my own blog or other blogs? Thanks!

NetPuter
30. September 2008

I had found this for a long time.
Unh~THX!

Sag Deine Meinung!

custom-wordpress-theme

Alex sagt zu Superfish jQuery Menu IE z-index Bug:
Nice one! I read the klog post before reading this and somehow I had missed...

webdemar sagt zu Frohes Neues!:
@Kristin: Vielen Dank ;-)...

Kristin sagt zu Frohes Neues!:
Ich wünsche dir auch ein frohes neues Jahr. Ich wünche dir viel Glück bei d...

Alec sagt zu WordPress Theme deFusion 0.9:
Really like your deFusion theme. I've tinkered with it, and thought you mig...

Ahmet Topal sagt zu Sticky Posts in WordPress 2.7:
Ich glaube, dass war Otto42, der dass mit dem Query gesagt hat :?...