Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I was wondering if the images generated in the comment sections are "set" somewhere in the WordPress backend, and I'm not sure where this setting is. Please see this image to see what i'm referring to:

enter image description here

The user Jimmy Jacob doesn't have an image yet the commentor Catherine does. Without installing plugins, is there a native WordPres setting which would let me upload an image to use in this area.

share|improve this question

1 Answer

up vote 1 down vote accepted

Here's a function you can put in your theme's functions.php file to force your own default avatar. Update the $myavatar line to point to your image path/name:

// Adds a new default avatar to the list in WordPress admin
add_filter( 'avatar_defaults', 'mytheme_addgravatar' );
function mytheme_addgravatar( $avatar_defaults ) {
    $myavatar = get_bloginfo('stylesheet_directory') . '/images/my-avatar.gif';
    $avatar_defaults[$myavatar] = 'New Default Gravatar';
    return $avatar_defaults;
}

Once you've added this function, your new avatar will appear in the list in the WP control panel in the "Settings > Discussion" area. Select it and save. Now if visitors don't have their own Gravatar your new avatar will appear instead.

(If you're just looking for how to get your own Gravatar, which will show up on most WordPress blogs/sites in the comments section, go to http://gravatar.com and sign up for a free account.)

Hope this helps - best of luck!

share|improve this answer
Great thanks, that was excellent. – Ankur Dec 6 '11 at 3:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.