Author Gravatar For WordPress

I was looking to show gravatar (photos) on the author’s post on a WordPress website. I looked around, but most WP plugins are designed to show gravatar on the comments, not on the actual post.

There are hacks around for this, but they seemed too complicated for this simple task.

One had the promise, but strangely ended up not working.

In the end, I’ve had enough, and delved into WP’s source code. Lo and behold, it’s actually pretty easy. Just insert this in main template’s code, and voila — author’s photo.

<img src="http://www.gravatar.com/avatar.php?gravatar_id=<?php global $authordata; echo md5($authordata->user_email); ?>" />

Hope it helps someone.

(credit to tyr for the idea)

23 thoughts on “Author Gravatar For WordPress

  1. Maksudnya piye toh? Lha yang nulis kan cuma kita doang. Kecuali kalo agregasi atau web yang ditulis oleh banyak orang

  2. btw; to show gravatar in comments without installing the gravatar plugin, just paste this (single) line into comments.php :
    .
    <div style="float: right;"><img src="http://www.gravatar.com/avatar.php?gravatar_id=<?php global $comment; echo md5($comment->comment_author_email); ?>" /></div>
    .

  3. In the end, I’ve had enough, and delved into WP’s source code. Lo and behold, it’s actually pretty easy. Just insert this in main template’s code, and voila — author’s photo.

  4. You have a lot of good stuff here.This post is superb. You have a very good knowledge about this matter. The way you wrote very nice.

    Thank you for this nice blog!

  5. Firefox is getting slower and slower. I’m using Google chrome instead, because I find Firefox slower and it’s affecting my work as a content writer.

  6. Best iPhone 4S Transfer can help users transfer various mainstream media files to PC, such asmusic/movie/Pictures/TVShows/Podcast/iTunesU/eBooks/Camera Roll/Ringtone/SMS/Contacts/Voice memos/Camera shot, etc. Also, it enables you to copy all iPhone 4/white iPhone 4. Furthermore, it has wonderful Backup Function to change all your SMS, Contacts files to database files for safety.

    iphone 4s ringtone maker, a best assistant for iphone 4S users, can make iphone 4s ringtone from popular video, dvd or audio files including AVI, MPEG, WMV, MP4, FLV, MKV, H.264/MPEG-4, DivX, XviD, MOV, RM, DVD, RMVB, MP3, WMA, AAC.
    Newly released iPhone 4S will be greatly welcomed among young fans, so you may have got one and can’t wait to transfer iPad video files to iPhone 4S? If you have all your iPad songs in your iTunes, transferring music from iPad to iPhone 4Swould be pretty easy – just sync the music to your iPhone 4S.

Leave a Reply

Your email address will not be published.