Previously, I wrote about how to get your own Gravatar. If you’re a serious blogger and really want your own identity, make sure to read that article.
If you’re a theme developer, there is time when you might need to change the Gravatar image size in your WordPress theme. Even if you’re not a developer, do not worry. This tutorial is very easy to follow. Today, I’ll share some snippets how to change the Gravatar image size in Author Box and Comment Section. This tutorial is specifically dedicated to Genesis Framework users.
1. Change Gravatar Image Size in Author Box
1 2 3 4 5 6 7 8 |
|
Make sure to change the number 80 to any size as you wish. Put the code above in your theme functions.php
file. If you’re using a child theme, make sure to put the code in your child theme’s
functions.php
file. Personally, I recommend to put the code in your functionality plugin. I’ll write more about that later.
2. Change Gravatar Image Size in Comment Section
While the previous code can only change the Gravatar size in Author Box, the code below can be used to modify the Gravatar size in comment section.
1 2 3 4 5 6 7 8 |
|
That’s it. I hope the tutorial will be useful.
Denrrou says
Hi!
Is there any way to set the nested comments to an smaller size?
What i would like to do is to make the first level comments show a gravatar size of 100px and the replies be 60px.
Is that possible?
Thanks a lot!
Editor says
Hi,
I’m not really sure how, but I think it’s possible via CSS. For example, we filter the size gravatar image of the first level comment using the snippet above. Then for the second and third level comments (or child comments), we can specify the width and height to be 80% and auto, respectively.
I believe you can find the class/id of the child comments from the WordPress Codex
or by simply search for it in Google.
john says
thanks for the help. useful