Posted on 13 October, 2008 By 27 Comments

How to Customize Gravatars in WordPress

 

Yesterday I decided to edit the gravatar settings for the images in my comments. I wanted to make the gravatars smaller and use a custom image for commenters who don’t have one rather than the default gravatar image.

I use the gravatar plugin and the following code is in my comments template file. You will want to locate this code in your comments template, if you want to make any of the same edits.

 

<?php gravatar(); ?>

There are 4 conditions that can be used with the gravatar code; rating, size, alternative image, and border.

Gravatars have ratings similar to movies. If you want to show gravatars that are rated not higher than R, you would put R in the conditions and everything rated R and below will show up in the gravatars. I’ve never seen gravatars rated higher than than that but maybe I don’t visit those sites.

The default size of the gravatar is 80×80. This is what the size will be if you don’t put anything in the conditions. I thought this was too big, so I changed it to 50.

This is the default image that is used when a commenter doesn’t have a gravatar. I wanted to change it to a logo for my own site. I uploaded the image to my webhost and then added the path to it in the conditions for the gravatar code.

The final condition that you can set is a color for a 1px border. I decided not to add this.

The changed code now looks like the following:

<?php gravatar("R", 50, "http://www.kimwoodbridge.com/wp-content/
themes/kimwoodbridge/images/asd2.jpg"); ?>

On a side note, this is my 100th post. It’s hard to believe but here’s to 100 more.

Related posts:

Posted In : WordPress Plugins | WordPress Tips

Did you enjoy this article? I can assist you with your WordPress or Facebook project. Contact me and I will provide you with an estimate. You can also connect with me on Facebook or follow me on Twitter.




FreshBooks

27 Responses to “How to Customize Gravatars in WordPress”

Trackbacks/Pingbacks
  1. Links about Wordpress | Some things will never change
  2. How to Customize Gravatars in WordPress
  3. How to add our own default avatar? - DIY Themes Forums
  4. Be Social Get a Gravatar :: 3 Green Angels
Leave a Comment
You may use: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

CommentLuv badge

About

Kim Woodbridge is an accomplished Information and Technical Consultant specializing in the entire implementation of a WordPress based website including installation, theme design, upgrades, unique customizations and ongoing site maintenance.

Recent Comments

    • Marbella: Hi Kim, To get a Valentine card from a child who has been working with it for a few days means so much. They show their...
    • Gaynell M. Jones: Hi Kim, Wow, This is amazing! How can you read this much and blog at the same time?.. Well I'm not that a reader myse...
    • Gaynell M. Jones: Wow! This are cute! I will creat this for my darling. Thanks for the sharing this wonderful Idea....
    • Cmack: I found this website that shows how to have thumbnails link to another page by using the alt/title info in the gallery. ...
    • Lily Rose: This is so cute! I love it when people make their day and do the same for their close ones...

Wordpress Services

  • Installation, upgrades and maintenance
  • Conversion of existing html and css templates
  • Theme and plugin recommendations
  • CSS customizations
  • Troubleshooting and tweaks for unique situations
  • Customization for individual blogging goals and needs
  • Training and advice