How to Change The Default Avatar

Posted by Nile | Posted in Tutorials | Posted on 11-07-2009 | Comments Off

Tags:

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.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • FriendFeed
  • Identi.ca
  • LinkedIn
  • Posterous
  • Reddit
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter
  • Yahoo! Buzz

Related posts:

  1. Applying Author Gravatar In Post
  2. Brand Your WordPress Login Without A Plugin
  3. Editing The Number Of Words For The Excerpt
  4. Disable Comments For Older Posts
  5. Add More Social Network Handles To Your WordPress Author Profile

About Nile Flores

Web and graphic designer fom Southern Illinois. I love to work with WordPress.

Connect with Nile at: Twitter | Facebook | LinkedIn

Nile has written 87 articles at WPAddict.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

Comments are closed.