About US: Comment Icon instead of default Gravatar


comment About US: Comment Icon instead of default Gravatar Most of the time, we just use gravatar icons. This comment icon, image an be used instead of default Gravatar icon. It is just better. Mystery man, blank, any gravatar image seems to be not sufficient.

There are different ways to implement this.

  1. Edit your functions.php file to stop redirecting and getting an image from a remote URL.
  2. Edit comments.php.
  3. Install a plugin for changing default gravatar.

About US: Changing gravatar icon: Edit Functions.php


add_filter( ‘avatar_defaults’, ‘newgravatar’ );

function newgravatar ($avatar_defaults) {
$myavatar = get_bloginfo(‘template_directory’) . ‘/path-to-your-image-folder/new-image.jpg’;
$avatar_defaults[$myavatar] = "ideviate";
return $avatar_defaults;
}

[warning] Remember this folder, image should be under your theme folder.[/warning]

About US: Changing gravatar icon: Edit Comments.php

Your comments.php includes a function to show gravatar icon. Just change the path to your new comment image file.


php echo get_avatar( $comment, 60, ‘http://URL-of-your-site/yourthemename/path-to-your-image-folder/new-image.jpg’); ?>

About US: Changing gravatar icon: Installing plugin

For a modular permanent solution, just install a plugin which does this for you. I don’t like redirects therefore I just used the worst solution, hard coding the comments.php.

You can get the plugin Add New Default Avatar to Add new option to the Default Avatar list.

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
About US: Comment Icon instead of default Gravatar, 10.0 out of 10 based on 1 rating

1 Comment

  1. GILLIAMRhoda says:

    Do you present the writing work service? Your ideas referring to this good post can be really hot.

    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)

Leave a Comment

You might also likeclose