Create a Custom Default Avatar

Create a Custom Default Avatar

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: , ,

3 Kommentare zu Create a Custom Default Avatar

NetPuter
30. September 2008

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

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!

Designaholic
7. November 2008

Sweet tip dude, nice clean blog too!

Sag Deine Meinung!

Für das Hosten von WordPress Blogs empfehlen wir Webspace von Hostloco. Für alle Schweizer: Kourtis-Solutions.ch.

Sciabb sagt zu Display Recent Posts without Plugin:
Where do you exactly place the code $recent = new WP_Query(”showposts=5&...

Meg Stefani sagt zu WordPress Theme deFusion 0.8:
The Theme looks great....

Pickle sagt zu Superfish jQuery Menu IE z-index Bug:
Good solution!!!! thx --- adding .sf-menu, .sf-menu * { z-index:...

Jared sagt zu Aktuelle Kategorie in der Post-Einzelansicht hervorheben:
Ja so ungefähr habe ich es bei mir auch gemacht. Nur den Home Button habe i...

Simon [webdemar] sagt zu Aktuelle Kategorie in der Post-Einzelansicht hervorheben:
@Jared Den Code habe ich in der Zwischenzeit auch erweitert. Das könnte ...