Title: Problem Changing Default Avatars
Last modified: August 19, 2016

---

# Problem Changing Default Avatars

 *  [schmacklab](https://wordpress.org/support/users/schmacklab/)
 * (@schmacklab)
 * [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/)
 * I am trying to change the default avatars for my site. I have used this code:
 *     ```
       // Add a default avatar to Settings > Discussion
       if ( !function_exists('fb_addgravatar') ) {
       	function fb_addgravatar( $avatar_defaults ) {
       		$myavatar = get_bloginfo('template_directory') . '/images/avatar.jpg';
       		$avatar_defaults[$myavatar] = 'Doc4';
   
       		return $avatar_defaults;
       	}
   
       	add_filter( 'avatar_defaults', 'fb_addgravatar' );
       } ?>
       ```
   
 * Everything seems to be working as the name of the new avatar shows up in the 
   discussion settings and in the source code the href of my image is correct. But
   alas no image shows up. The new default shows up as blank.
 * And yes, I have named it avatar.jpg and placed it in the templates images file.
 * Any ideas?

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Thread Starter [schmacklab](https://wordpress.org/support/users/schmacklab/)
 * (@schmacklab)
 * [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/#post-1437868)
 * anyone?
 *  [gregnak](https://wordpress.org/support/users/gregnak/)
 * (@gregnak)
 * [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/#post-1437874)
 * Got a link to the site, where there is a post using the default avatar?
 *  [pegalina](https://wordpress.org/support/users/pegalina/)
 * (@pegalina)
 * [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/#post-1437877)
 * Having a similar problem. Using Prosumer theme and there is an avatar above the“
   About” on sidebar – can’t find where to delete and add my own avatar. I’m not
   a technie. Help??
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/#post-1437881)
 * [@schmacklab](https://wordpress.org/support/users/schmacklab/) here’s my code
 *     ```
       if ( !function_exists('fb_addgravatar') ) {
           function fb_addgravatar( $avatar_defaults ) {
           $myavatar = get_bloginfo('template_directory').'/images/voodooEmpire.png';
           //default avatar
           $avatar_defaults[$myavatar] = 'The Voodoo Empire';
           return $avatar_defaults;
           }
        add_filter( 'avatar_defaults', 'fb_addgravatar' );
       }
       ```
   
 * looks like yours…except one thing I guess
    `('template_directory').'/images/voodooEmpire.
   png';` this line on yours….there appears to be a space between the dot and apostrophe
   before the path to the image
 * I’m not so strong at this stuff, and have no clue if this matter?
 * [@pegalina](https://wordpress.org/support/users/pegalina/)
    not familiar with
   your theme, but WP doesn’t have a default option to allow you to upload your 
   avatar. Natively, WP uses gravatar.com, you go to that website, upload your gravatar
   and WP will use it. If you have gravatar set up in settings->discussion
 * You can also use plugins to allow avatar upload. Or have a swing with using the
   code we are discussing here. It goes in functions.php of your theme and sets 
   a custom default avatar for any user who doesn’t have a gravatar
 *  [pegalina](https://wordpress.org/support/users/pegalina/)
 * (@pegalina)
 * [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/#post-1437884)
 * Thank you RVoodoo – I think I misspoke. It’s probably not an avatar but an image
   that is above my About section on the sidebar. I just want to get rid of the 
   default image and put something else in there. I think I may have to hire someone
   to do this since this seems WAY beyond my abilities, not knowing where to look
   for this…
 * If you have any advice for me I’d appreciate it.
 * Thanks!
 *  [Rev. Voodoo](https://wordpress.org/support/users/rvoodoo/)
 * (@rvoodoo)
 * [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/#post-1437887)
 * advice would be easier with a link to your site to take a peek
 *  Thread Starter [schmacklab](https://wordpress.org/support/users/schmacklab/)
 * (@schmacklab)
 * [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/#post-1437906)
 * Hey everybody,
 * Thanks for the feedback. No solutions yet it seems but here is link to a page
   on my site with comments at the bottom. I am meeting with my advisor tomorrow(
   i’m a student doing a WP independent study) so if he has any answers I’ll post
   them.
 * [http://www.schmacklab.com/2010/03/22/retaliation-book1-cornelius-and-ovy/](http://www.schmacklab.com/2010/03/22/retaliation-book1-cornelius-and-ovy/)
 * Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Problem Changing Default Avatars’ is closed to new replies.

## Tags

 * [custom](https://wordpress.org/support/topic-tag/custom/)
 * [default](https://wordpress.org/support/topic-tag/default/)

 * 7 replies
 * 4 participants
 * Last reply from: [schmacklab](https://wordpress.org/support/users/schmacklab/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/problem-changing-default-avatars/#post-1437906)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
