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.