Top Ad unit 728 × 90

Change the Default Gravatar Button


The default mystery man is really annoying for most users. Plus if you have one more chance of branding your blog, then why not do it. Changing your default gravatar lets you brand your blog more. With this snippet below you can change your default gravatar.
First you need to open your functions.php which is located in your template folder. If you don’t have one then create one and insert the following code:
1add_filter( 'avatar_defaults''newgravatar' );
2
3function newgravatar ($avatar_defaults) {
4$myavatar = get_bloginfo('template_directory') .'/images/gravataricon.gif';
5$avatar_defaults[$myavatar] = "WPBeginner";
6return $avatar_defaults;
7}
In the code the image is being extracted from the theme directory and it is called gravataricon.gif obviously you will change it to your image name. Where it says WPBeginner, that is the name of the avatar of how it will show in your admin panel options area.
Head over to your admin panel and click Settings > Discussion and change the icon, and now you have a branded comment area with your logo.
Change the Default Gravatar Button Reviewed by Unknown on 10:16 PM Rating: 5

No comments:

All Rights Reserved by Boca Raton Real Estate © 2014 - 2015
Powered By Blogger, Designed by Sweetheme

Contact Form

Name

Email *

Message *

Powered by Blogger.