How to Change The Default Avatar
Posted by Nile | Posted in Tutorials | Posted on 11-07-2009 | Comments Off
Tags: gravatar
Sometimes that default Gravatar with the gray and white seems boring. Lucky for you, instead of altering internal WordPres files, you can harness the power of adding a filter to your theme’s functions.php to change your default image to display.
1. Open your template’s functions.php
2. Insert the following code:
add_filter( 'avatar_defaults', 'newgravatar' );
function newgravatar ($avatar_defaults) {
$myavatar = get_bloginfo('template_directory') . '/images/yournewgravatar.jpg';
$avatar_defaults[$myavatar] = "Your New Gravatar";
return $avatar_defaults;
}
3. Change where younewgravatar.jpg to the image you want and change the following text, Your New Gravatar to the name you wish to have your new default avatar be called.
Related posts:







