Friday 6 January 2012

How To Get Gravatars in Post Titles in Wordpress Articles

If you are a WordPress user, then you will be familiar with the WordPress Post Author Column, but the Gravatars or Globally Recognized Avatars (more about Gravatars) are not included, but there is a very simple WordPress Trick to include it next to the title itself.

Recently WordPress added the Gravatars to their core code, so now it is very easy for you to add your own customized Gravatar next to your Article Title or your Post Title.

Just Insert the Following code and its as easy as that -



<?php echo get_avatar( get_the_author_email(), '80' ); ?>


The get_the_author_email gives the output for the Author's E-Mail and size 80 is changeable to whatever size you want. This determines the size of the Gravatar in Pixels.

Here is an example -


You can implement that code wherever you want, it does not have to be next to the title itself. Be Creative with that!

Use of Gravatar is necessary only when you run a multi-author blog, as if you are a single author you can just have a thumbnail and about column in the sidebar itself like Amit Agarwal at labnol.But if you do run a multi-author blog then this aspect can be very useful indeed.

If you have any doubts please leave a comment, I will get back to you soon.



Gautham On Google+

Get free daily email updates!

Follow us!





0 comments:

Post a Comment

This is a PR 4 Do-Follow Blog, so please give us valuable feedback and not Spam!

Meet the Author

Gautham A S

Gautham A S is a personal tech columnist and blogging expert at TechGau.Org, one of the leading Tech, How-To and Blogging Tips blogs