• Posted: 2010-11-10
  • Author: Filip Stefansson
  • Tags:

Customize default avatar

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
<?php
// Make a new default gravatar available on the dashboard
function newgravatar ($avatar_defaults) {
    $myavatar = get_bloginfo('template_directory') . '/images/tweaker.jpg';
    $avatar_defaults[$myavatar] = "Tweaker";
return $avatar_defaults;
}
add_filter( 'avatar_defaults', 'newgravatar' );
?>

Instructions:

If you are bored by the default avatars that comes with WordPress, you can easily add your own. Just create or download a better looking one, and then add the following to functions.php.


Related links:
http://tweaker.co.za/2010/11/06/customize-the-default-gravatar/
Share this snippet

If you like this snippet, share it with friends!