There are two ways to change the Gravatar image size in WordPress:
Using the WordPress Customizer
- Go to Appearance > Customize.
- In the left sidebar, select Comment.
- In the right sidebar, under Gravatars, you will see a field for Image Size. Enter the desired size in pixels.
- Click Publish to save your changes.
Using FTP
- Connect to your WordPress site using FTP.
- Navigate to the following directory:
wp-content/themes/[your-theme-name]/
- Open the
comments.php
file in a text editor. - Find the following line of code:
PHP
$avatar_size = 96;
Use code with caution.
- Change the value of
96
to the desired size in pixels. - Save the
comments.php
file and upload it back to your WordPress site.
The new Gravatar image size will now be used for all comments on your site.
Note: The maximum Gravatar image size is 512px by 512px. If you set the image size to a larger value, the Gravatar may appear blurry.
Additional tips:
- You can also change the Gravatar image size for specific user roles. To do this, you will need to edit the
user-role.php
file in your theme. - If you are using a child theme, you can create a custom
comments.php
file and override the default settings. - You can also use a WordPress plugin to change the Gravatar image size. There are many plugins available, so you can choose one that best suits your needs.
Read also: How to embed videos in WordPress posts/pages
Do you want to learn web design with WordPress with Experts? Register today