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.

Related Posts Plugin for WordPress, Blogger...

Tagged with:

Filed under: Better websiteHow ToTips

Like this post? Subscribe to my RSS feed and get loads more!