How To Change The Default Avatar In Your WordPress Blog

27.07.10 by Jerome in Tutorials

How To Change The Default Avatar In Your WordPress Blog

Here is a tip for today- I will show you how to add your own custom avatar into your WordPress blog. Why would you do that? Maybe because you want to make your blogs look more professional or simply because your are tired to see Mystery Man” everywhere. Just follow these quick steps below:

Step 1

First create your own custom avatar (recommended size width: 100px height: 100px) and drop it into your theme images folder.

Step 2

Under your theme files open your functions.php file and drop the code below and make sure to change your avatar path and name:

// Custom Default Avatar
 if ( !function_exists('addgravatar') ) {
    function addgravatar( $avatar_defaults ) {
    $myavatar = get_bloginfo('template_directory').'/images/custom-gravatar.jpg'; //=> Change path to your custom avatar
    $avatar_defaults[$myavatar] = 'Custom Avatar'; //=> Change to your avatar name
    return $avatar_defaults;
    }
 add_filter( 'avatar_defaults', 'addgravatar' );
}

Step 3

In the admin area go to the Settings tabs –> Discussion and select your new avatar and click save.

custom avatar How To Change The Default Avatar In Your WordPress Blog

Related posts:

avatar, images

Get More Wordpress Tips & Tricks

Liked this post? subscribe to our email updates or RSS feed!

Leave a Reply

Want your picture in comment? Go to gravatar.com & upload your preferred avatar for free.

blog comments powered by Disqus