How to Change the size of Gravatar Photo
![]()
Today, I’ve change the comment gravatar photo size on this website: I want to share with you how I did it. Now, I understand what Patricia has just written in her guest post about how to communicate to non-techie. I’ll have to warn that is post is a bit advance and not for newbies.
I shall assume you already know the anatomy of a WordPress theme, you know PHP, and you know how to edit WordPress theme files.
To change increase the size of the Gravatar photo just editing the CSS properties of the photo will not do the job as you would be stretching the size of a smaller photo and cause a lost in the quality of the photo.
To change the size of the gravatar photo, you’ll have to edit the comments.php file in your theme, this file is found in /wp-content/themes/youractivetheme.
Open comments.php and identify this function wp_list_comments()
If it looks like that wp_list_comments(‘type=comment’);
Add this piece of code &avatar_size=50 so it now look like that wp_list_comments(‘type=comment&avatar_size=50′);
Now, Ive changed the default gravatar size from 32 pixel to 50 pixel.
If you have Wp Threaded Comment Plugin you’ll have to edit its setting so the gravatar size is the same for the threaded comments as well. This is easier as you won’t have to edit the plugin codes.
To edit the Wp Threaded Comment plugin go to Settings > Wp Threaded Comment Identify the following section:
Edit Comment HTML
edit the following code with is found in a textarea:
<div><?php if(function_exists("get_avatar")) echo get_avatar( $comment, 50 ); ?><p><cite>[author]</cite> Reply:[moderation]<br /><small>[date] at [time]</small></p>[content]</div>
Change the red number to your desired size. From 32 to 50 in this case.
Then you are done.
Your Gravatar size will be different.
Oh, by the way, have you subscribed to my newsletter yet? I really want to use my newsletter to keep you up to date with my latest tips and notify your of new blog post releases. So fill your name and email address below and click Subscribe Me.
More From benwan
Incoming search terms:
- resize gravatar photos
- css coding to change gravatar size in comments
- gravatar photo dimensions
- gravatar picture size
- gravatar recommended image size
- how to change gravatar size wordpress css
Tagged with: gravatar • wordpress theme customisation
Filed under: Better website • How To • Tips
Like this post? Subscribe to my RSS feed and get loads more!
Welcome, my name is Ben Wan. I help people get started online by building their website. I also train them to run their own website.








Solar Energy Facts and News Website
Eco-Office for Rent near Perth








Hi Ben
So if I need this doing I’ll be calling on you or one of my other techie buddies eh lol
I’m sure there will be those who will really find this post helpful. And thanks for the opportunity of GP on your blog Ben. Much appreciated.
Patricia Perth Australia
Patricia@lavenderuses recently posted..Are You a Tweetheart-Commenter…or both!
[Reply]
Ben Wan Reply:
December 13th, 2010 at 7:56 pm
Hi Patricia,
You are welcome.
This is the first post I’ve done in this style. I know that it’s very high level. A non-programmer wouldn’t have a clue what I’m talking about, however a WordPress developer will know exactly what I’m talking.about.
I agree the above is not English.
This will give my readers a glimse of what we developers handle to get you the website you want.
Ben Wan
Ben Wan recently posted..Get indexed- get ranked- get traffic
[Reply]
Wonderful info shared here. Thanks ben, I was searching for this ,it comes in handy. I was searching for some plugin’s to support this, but this wordpress hack comes in handy. Thank you so much,…
Beth
Beth Owens recently posted..Symptoms of Ovarian Cysts
[Reply]
Ben Wan Reply:
December 13th, 2010 at 8:50 pm
Hi Beth,
I appreciate your comment, but I have to tell you, I almost would not have approved this comment because you do not have a gravatar, your comment almost read like a spam comment and you do not have any contact details, Twitter or Facebook on your site.
I’ve approved this comment because, I saw the comment of Mitchell Allen on your website.
Yes, I can see the gravatar on your site is a bit small. If you need any help such as increase the size of your gravatar photo, increase your web traffic, integrate Twitter and Facebook with your website, etc, You can use my contact form and get in touch with me.
Ben Wan.
Ben Wan recently posted..Don’t Go Broke Trying to Build an Online Business
[Reply]
hi Ben. I didn’t realize it was so easy. Now I can change my Gravatar every week if I want to. Or I could spend the time trying to work out what colour is the default text colour on my blog. It shows black in the admin panel but prints white in the post. But when I ‘choose’ black it prints black I need that book you recommended. BTW I like your new Gravatar photo. Did you change the size?
.
[Reply]
That seems amazingly easy!
So it has not effect on css or anything and doesn’t screw anything up? I Like it
[Reply]
Ben Wan Reply:
December 16th, 2010 at 8:04 am
Hi Peter,
Welcome here. No, this WordPress theme hack doesn’t affect the CSS.
Are you a bit of a coder yourself?
Ben
Ben Wan recently posted..How to Resolve WordPress RSS Widget Time Out Error
[Reply]
Hi Ben

Thanks for the tips. Like that kind of small twieks
Thomas@ IT-Blog and reviews recently posted..Remove old settings from network cards that no longer are installed
[Reply]