Change Default Comment Avatar In WordPress

I have a top commentator widget in my footer and some people have been asking how I managed to change the default WordPress comment avatar into an image tailored to fit into my theme. The current avatar options are fine, but do you really want something that looks like what everybody else is using on WordPress? Of course not. So how did I get my custom avatar image to show up in my WordPress dashboard as a new option under Settings -> Discussions like this?

Here’s how: Just make your own avatar (size should be 80px by 80px), upload it on the images folder of your current theme and insert the below code in your functions.php:

// Add Custom Gravatar
add_filter( 'avatar_defaults', 'newgravatar' );
function newgravatar ($avatar_defaults) {
    $myavatar = get_stylesheet_directory_uri() . '/images/newgravatar.png';
    $avatar_defaults[$myavatar] = "CustomGravatar";
    return $avatar_defaults;
}

Make sure to change ‘/images/newgravatar.png’ to the name of the avatar you uploaded to your images folder. Your custom avatar should now appear in your WordPress dashboard as a new option under Settings -> Discussions. Make sure to select the custom avatar you just made and save the changes. That’s it!

SHARE THIS article
Facebook
Pinterest
Twitter
Print
Email

GET UPDATES

Sign up to my newsletter so you get first peek into my detailed reviews, latest updates and occasional fun emails.

7 Responses

  1. gusto ko man i-try, saka na lang pag gagawa ulit ako ng isa pang blog. I have wordpress pero wala maxadong time para ma familiarize sa settings and all, na try ko once pero nahirapan ng bungga ‘te. next time, at least alam ko na gagawin sa avatar. ^^,

  2. Namimiss ko ang 2008, kasi hindi ako hirap mag sulat nuon, kung ano na lang ma isip ko, type agad kahit alam kong walang sense, at least nakakatapos ako ng isang blog post.

Leave a Reply

Your email address will not be published. Required fields are marked *

STAY IN THE KNOW

Sign up to my newsletter so you get first peek into my new uploads, detailed reviews, latest updates and occasional fun emails.