Jan
19
Gravatar WordPress Comments
Today I searched gravatar wordpress comments trying to figure how to get the gravatar images next to the comments in a wordpress.org theme. I was surprised to find that wordpress natively supports gravatars in 2.5 and above. To use it you just call get_avatar and pass in the email and an optional size and it spits out the image html. Once I found the loop of comments in the template code, I just added the below code in a div next to the comment text.
I used comment_author_email on the php comment object to get the email address of the person who made the comment. It was pretty painless to do and a great feature to add to my template.