Custom default gravatar image

Adding this PHP code to the functions.php of your wordpress theme will set the default avatar.

 

 

function default_gravatar ($avatar_defaults) {
$myavatar = get_bloginfo('template_directory') . '/images/default.jpg';
$avatar_defaults[$myavatar] = "Default Gravatar";
return $avatar_defaults;
}
add_filter( 'avatar_defaults', 'default_gravatar' );

Leave a comment