ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel
  • »
  • Technology»
  • Internet & the Web»
  • Web Page & Web Site Development

How to Change WordPress Default Comment Avatar Images without Plug-in

Updated on October 9, 2015

Introducing of Post

Implementation of an avatar is a common subject of bloggers. More and more blogger are using an avatar in their WordPress blog. Not only bloggers are following this trend, but also many web designers are following the same trends. Because, many web designers are using avatar image for focusing their deign and making a nice comment box for highlighting theme or business. Although, most of the designer use own avatar image for their branding. Mystery Person is the default avatar image of WordPress site. That means you will see mystery person default avatar after you had finished wordPress Insulation.

Mastery Person Wordpress avatar

While blogger has a gravatar account and they know about gravatar. But a newbie blogger has not a gravatar account. That results, when anyone posts a comment on the website, mastery person avatar icon take a place over the avatar section. Probably, you have seen the many blogs.

On the other hand, Good avatar image is always best for your reader. It will very attract for website commenter. Besides if you use a new avatar image on your website site, you will see that under the section of ‘Dissuasion setting.’

Create your own avatar without Using Plug-in

If you don’t use WordPress default avatar image on your website, you can easily add your own avatar icon by adding a filter to the avatar_defaults hook.

Upload your new custom image on your theme function.php file. Here 2 ways to you can upload a new custom image on your theme file.

1. FTP(FileZilla): You can upload the image by using FTP account. So, here you can use FileZilla.

Download FileZilla

2. cPanel: You can upload the image by using cPanel. See tips:-

Step:1 Login your cPanel account.

Step:2 Click file manager

Step:3 Click ‘wp-content’ file

Step:4 Click ‘theme’ file

Step:5 Click ‘images’ file

Step:6 finally upload your new image.

Note: you can use the same step for FTP (FileZilla) access.

After uploading the image on your theme file image directory, add this code to your theme function.php file.

---------------------------------------------------------------------

add_filter( 'avatar_defaults', 'newgravatar' );

function newgravatar ($avatar_defaults) {

$myavatar = get_bloginfo('template_directory') . '/images/new_default_avatar.png';

$avatar_defaults[$myavatar] = "Custom Avatar Image";

return $avatar_defaults;

}

---------------------------------------------------------------------

After implementing the code on function.php file, you need to change the location of the image file. Example you must change images/new_default_avatar.png section from the code. It must save under the theme folder that your are using.

Not that’s all; you can change only ‘Custom Avatar Image’ from the following line.

$avatar_defaults[$myavatar] = "Custom Avatar Image";

Because, its only avatar name not others features.

After finishing all process, you can check your new custom avatar image from WordPress dashboard Settings > Discussion area.

WordPress new custom avatar

Vote About This Hub.

Is this hub helpful for you?

See results

Comments

    0 of 8192 characters used
    Post Comment

    No comments yet.