Posted on 13 October, 2008 By Kim Woodbridge 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:
  • How to Link NextGEN Gallery Images to an Individual Page or Post in WordPress
  • WordPress: Missed Schedule for Scheduled Posts – A Plugin Fix
  • Using Thumbnails for Excerpts Plugin with Query Posts to Make a Custom Sidebar Block in WordPress
  • Using WordPress Custom Fields to Display NextGen Gallery Slideshows Conditionally
  • Random WordPress Quotes Without A Plugin
  • Posted In : WordPress Plugins | WordPress Tips
    If you enjoyed this post, please subscribe to my RSS Feed

    Post to Twitter   Post to Delicious   Post to StumbleUpon

    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> .


    Recent Comments

      • softize.net: Hi Kim, I must say this guide was excellent for everyone. You give detailed instructions and security notices that ever...
      • Julie Walraven | Resume Services: This post stuck with me for a long time... I finally listened awhile back and dropped the connection. Then I realized in...
      • Kim Woodbridge: Hi Keith - I originally joined Facebook to find an old friend. I never expected to end up liking it as much as I do....
      • Kim Woodbridge: Hi Rajat - Thanks for the info! I'll try it out as soon as I get the chance....
      • Kim Woodbridge: Hi Timothy - I'm glad you agree - it seems that more people are using it. I'm not seeing quite as many FB updates that ...
      • Kim Woodbridge: Hi David - It is a fine line. My Mom used to sign me up for activities like gymnastics that I didn't want to do because...
      • Kim Woodbridge: Hi Ajith - This was her first time but I hope it gives her the confidence to continue. She did have a great time!...
      • David Rogers: Like you I was very shy as a child and would never have done anything like appear on stage. My children have recently le...