Categories
Wordpress

How to Change or Add New Default Comment Avatar in WordPress

WordPress don’t provide any option to add default avatar directly from comment discussion page ,you can either disable or  use available default avatar provided by wordpress .

But if you are looking to add your own default Comment avatar in WordPress then you can do this by adding this little function to functions.php of your theme and it will add 2 Avatar from your folderimages of your theme directory.

/** * add a default-gravatar to options */
if ( !function_exists('fb_addgravatar') ) { function fb_addgravatar( $avatar_defaults ) { $myavatar = get_bloginfo('template_directory') . '/images/avatar.gif'; $avatar_defaults[$myavatar] = 'techpur'; $myavatar2 = get_bloginfo('template_directory') . '/images/myavatar.png'; $avatar_defaults[$myavatar2] = 'techpur.com'; return $avatar_defaults; } add_filter( 'avatar_defaults', 'fb_addgravatar' ); }

Please Note, that the avatars have a size of 60 pixel.You can also use more px avatar but it may effect you comment box look.

By Tarun

is a professional blogger from Jharkhand, India. He writes about Blogging, Social media, WordPress, SEO, Technology and Make money online.Follow Him on Google Plus

4 replies on “How to Change or Add New Default Comment Avatar in WordPress”

Um, I read this just the other day at Blondish.net and I know the gal there pulled it from her WordPress site WPAddict that has been around over 2 years. Ive read your site from time to time and I just keep seeing content from other sites rewritten and posts. Are you going to give credit to where you got the idea for the tutorial or the other places you rewrote? I’ve already sent the gal an email about this.

plz send me the answer of my question…my friend request is blocked for 30days,how can i release it?

You have to wait for 30 Days , Don’t send friend request.to any stranger If you do this you will be blocked permanently.

Comments are closed.