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”
ntar munculnya di sebelah mana ya mas? patut dicoba sih
Maksudnya piye toh? Lha yang nulis kan cuma kita doang. Kecuali kalo agregasi atau web yang ditulis oleh banyak orang
firman & qzoners — contohnya bisa dilihat disini 🙂
bisa dicoba tuh di planet terasi. minta sama ronny, gih…
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>
Hey, much easier than I thought. Thanks!
interesting for me. thanks a lot
bisa dicoba tuh di planet terasi. minta sama ronny, gihâ€¦
I was looking to show gravatar (photos) on the authorâ€™s post on a Word Press website. I looked around, but most WP plugins are designed to show gravatar on the comments, not on the actual post.
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.
kl gitu saya nyoba juga mas, terlambat banget ya, maklu pemula nih…
So easy! Thanks!
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!
Try this code. It seems easier.
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.
I looked around, but most WP plugins are designed to show gravatar on the comments, not on the actual post.
wordpress is really popular nowadays. People like post something on their own blog.
Good and excellent information post. Thanks for sharing this post.
Good and amazing information post. Thanks for sharing this post.
Good and nice information post. Thanks for sharing this post.
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.