Option to Add Your Own Custom Avatar
Posted on October 26, 2009 and last modified on October 31st, 2009.
By adding this little bit of code [below] to the functions.php file, this theme has the ability for you to change your own avatar within the WordPress Dashboard – Discussion section.
So, go open your functions.php file and make the two small changes which refer to ‘FreshlyPressed’ above. Upload your image to the correct directory and then go into Admin – Discussion and down the bottom of the page you will see your shiny new, customised avatar ready to use as the default.
// CHANGE THE DEFAULT AVATAR IN WordPress
// -----------------------------------------------------------------------------
add_filter( 'avatar_defaults', 'newgravatar' );
function newgravatar ($avatar_defaults) {
$myavatar = get_bloginfo('template_directory') . '/img/freshlypressedgravatar.png';
$avatar_defaults[$myavatar] = "FreshlyPressed";
return $avatar_defaults;
}
![]()













[...] Add-Your-Own for Default Gravatar [...]