Code Snippet
Display a User Gravatar from an Email Address
<?php
$gravatar_link = 'http://www.gravatar.com/avatar/' . md5($comment_author_email) . '?s=32';
echo '<img src="' . $gravatar_link . '" />';
?>
The variable "$comment_author_email" would be a string of a valid email address. If the email isn't in the Gravatar database, it will return a default graphic. "$comment_author_email" is the default WordPress variable that populates from a cookie for people who have previously commented (if the theme supports it).
Thanks! This is exactly what I was looking for!
Really cool tip Sir i was searching same from centuries. Thanks a lot
Thanks a million, I noticed that WordPress had the ability to show Avatars, But i couldn’t for the life of me work out how to add them. Saw this post, and thought I would give it a go. :)
Also, this should post my gravatar i presume?
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.