How To Change The Default Gravatar For Comments In WordPress ?

You can easily brand your blog more by using your own default avatar for comments. To say good bye to Mystery Man, follow these steps:

Step-1 Open you theme’s image directory and upload your logo for default avatar. Suppose you uploaded the default avatar image defaultavatar.gif in your theme’s image directory.

Step-2 Now open your theme’s function.php file and add the following action:

add_filter( ‘avatar_defaults’, ‘newgravatar’ );

function newgravatar ($avatar_defaults) {
$myavatar = get_bloginfo(‘template_directory’) . ‘/images/defaultavatar.gif’;
$avatar_defaults[$myavatar] = “MyAvatar”;
return $avatar_defaults;
}

Step-3 Now you can visit your WP Dashboard->Settings->Discussions, scroll down to Default Avatar section and choose your new uploaded default avatar for your WordPress site.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.