Gravatars are those profile pictures you see next to comments and profile throughout WordPress sites. If you have a Gravatar set up and tied to your email address, and you comment on a WordPress site using that email address, chances are your Gravatar will appear alongside that comment. Allowing Gravatars to be displayed alongside comments makes the experience more personal, and makes it easier for you and your visitors to see who says what, and where. The default Gravatar that WordPress outputs is 32 pixels by 32 pixels in size.
Which is too small for our design. So let me quickly show you how we can change that Gravatar size. In my design, my Gravatars are 50 pixels by 50 pixels. Now the Gravatar service, which you find at gravatar.com, will actually output Gravatars up to a very large size for you. And how it works is, you request a Gravatar of a certain size, and then that image is auto generated by gravatar.com and injected. So if you ask for a 50 by 50 Gravatar, you get a 50 by 50 image. If you ask for a 62 by 62 Gravatar, you get a 62 by 62 image.
By default, Gravatars are automatically displayed when you display comments within WordPress. It's all controlled from comments.php. And the Gravatar is generated by this wp_list_comments function. Now by default like I said the Gravatar that's output is 32 by 32 pixels. So if you want to change the Gravatar size, all you need to do is go to wp_list_comments and add another variable called avatar_size. Now you can set the number you want. So if I want a 50 by 50 Gravatar, I simply say 50, then add a comma.
Save comments.php, and reload my page. And now you see I get 50 by 50 Gravatars. If I right click on one and inspect it. You'll see the image is exactly 50 by 50. You'll see that the image is displayed as 50 by 50, and you'll also see that the image itself is 50 by 50. If, for some reason, you don't want to show Gravatars, this is also how you hide them. If you don't want to show Gravatars at all, you simply set avatar_size to zero. And now if you reload the page, the function won't do a call to Gravatar.
So not only do you not get the Gravatar, but you don't get the wrapping around it. So you have completely clean markup without any empty boxes. But for my design, I want my Gravatars to be 50 by 50. So, I'm going to set it to 50. Save, reload again to make sure that it still works, and now I have the Gravatar size I want.
Get unlimited access to all courses for just $25/month.Become a member
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Your file was successfully uploaded.