Posted on 13 October, 2008 By Kim Woodbridge 27 Comments

How to Customize Gravatars in WordPress

 
Share

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
  • 2 Ways to Like Add Facebook Like to Your WordPress Site
  • Using WordPress Custom Fields to Display NextGen Gallery Slideshows Conditionally
  • Posted In : WordPress Plugins | WordPress Tips
    If you enjoyed this post, please subscribe to my RSS Feed. You can also connect with my Facebook page or follow me on Twitter.



    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 Enabled

    Recent Comments

      • Ari Herzog: Agreed on the updates/inbox snafu. I rarely see page updates and I know where they are! .-= Ari Herzog´s last blog .....
      • jayson: Kim, Love the themes. I am looking to update the theme on my site to something more appropriate. My site is all abou...
      • vered: "I wish more people would use this. I think it’s silly when I get updates for things occuring in Kansas and California –...
      • Dennis Edell @ Direct Sales Marketing: I was speaking generally, not specifically this month. how exactly do you work things? .-= Dennis Edell @ Direct Sales M...
      • Lucy Beer: Unfortunately I think next to no-one actually sees those "Updates". They're buried in a subsection of the inbox and I do...
      • Kim Woodbridge: Hi Marbella - Thanks! I had a great time....
      • Kim Woodbridge: Hi Julie - I'll probably try kayaking again next summer but I don't know if I will become much of a kayaker - I had a di...
      • Kim Woodbridge: Hi Vered - If you ever get the chance, you should go. It's like a different world - it's so quiet and peaceful....

    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.

    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