What is Gravatar?
According to Gravatar Site:
AN “AVATAR” IS AN IMAGE THAT REPRESENTS YOU ONLINE—A LITTLE PICTURE THAT APPEARS NEXT TO YOUR NAME WHEN YOU INTERACT WITH WEBSITES.
A GRAVATAR IS A GLOBALLY RECOGNIZED AVATAR. YOU UPLOAD IT AND CREATE YOUR PROFILE JUST ONCE, AND THEN WHEN YOU PARTICIPATE IN ANY GRAVATAR-ENABLED SITE, YOUR GRAVATAR IMAGE WILL AUTOMATICALLY FOLLOW YOU THERE.
GRAVATAR IS A FREE SERVICE FOR SITE OWNERS, DEVELOPERS, AND USERS. IT IS AUTOMATICALLY INCLUDED IN EVERY WORDPRESS.COM ACCOUNT AND IS RUN AND SUPPORTED BY AUTOMATTIC.
A Gravatar is an image that follows you from site to site appearing beside your name when you do things like comment or post on a blog. WordPress usually use gravatar image for comment section and author image.
Add your Image to Gravatar
You can add your own image as the gravatar. Once you set your image as a gravatar, it will available all over the world. You set your image as gravatar at Gravatar site. Here you have registered and adding your image. Then it will become your gravatar.
Enable Gravatar In WordPress Comment
To Enable gravatar in WordPress site. Login to site dashboard and go to Settings. Now open Discussion and checked the Avatar Display checkbox. Follow steps given in below image.
Here you can enable as well as chose which type of gravatar to show. You can also choose gravatar rating.
How to Change Default Gravatar
You can also set your own gravatar for your site. WordPress allows you to do same. You can easily change default gravatar for your site.
Uploading Your New Gravatar:
Upload Your gravatar image to your site. And copy its URL.
Add Code to Change Default Gravatar:
Include following code to change default gravatar. You can add this code to your active theme’s functions.php or in child theme’s functions.php file. I suggest adding this code in the child theme. By adding code in the child theme, Change default gravatar will not vanish on theme update.
add_filter( 'avatar_defaults', 'ds_gravatar' ); function ds_gravatar ($avatar_defaults) { $myavatar = 'http://darshansaroya.com/wp-content/uploads/2017/02/customGravatar.png'; $avatar_defaults[$myavatar] = "Default Gravatar"; return $avatar_defaults; }
After adding mentioned code in the theme. You can see extra gravatar in Discussion Settings. As shown In below Image:
Check your default gravatar type to show them on the theme.
Hope you like this tutorial. Please share it to support me.
1 Comment
Nisha Prajapat
November 28, 2017 at 9:57 pmhelpful