Latest News
Home / About us / About US: Comment Icon instead of default Gravatar
About US: Comment Icon instead of default Gravatar

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.

About ideviate

iDeviate.org is the platfrom where we mostly publish blog posts. Mostly, these Professional, interesting, unique posts are about, Science News, Technology, Documentaries, Videos, Music, Art, Research, Health, Web Design, Networking, Apple, iPhone, Google and Making Money Online.

One comment

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

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

You might also likeclose