Adding Gravatar Hash id Code To Wordpress Easily
Well this is just my experiment by adding an avatar for my wordpress comment box. I use my logo as the avatar to give more personal touch on it. Before I play around in my template I have read a lot of articles about it and there are good articles, but those articles it’s not easy to followed for newbie like me.
Still I tried those tips and some of them work perfectly. But it didn’t make me stop the experiment. I think if I want to learn something I better try and learn from my mistake. And to get better result sometimes I make all things easier. So other newbies like me can follow the easy way.
After try many tips here is the simple way to add gravatar to my wordpress comment box.
- Prepare my logo for my avatar.
- Sign up to Gravatar.com
- Get the URL that gravatar gave to me and copy it to notepad and save it to my PC
The URL code look like this
http://www.gravatar.com/avatar/04567a8d755566d2fe1289c5267ea983?s=80
- And I opened the function.php file and looked for the function code to get the avatar.
The function code look like this one:
{ echo get_avatar($comment, 32 ); } ?>
- Now it’s time to play with the code,
{ echo get_avatar($comment, $size = ‘65′, $default = ‘http://www.gravatar.com/avatar/04567a8d755566d2fe1289c5267ea983?s’ ); } ?>
That’s it,
All I have to do is add new code after $comment.
There is number “32” on my original code, that’s the size of my avatar when it displayed on my wordpress comment box, but I changed it to “65”.
And there is number “80” behind the URL that I got from the gravatar, it’s also the size for the avatar. I remove it in the new code.
Now you can play around with those code and find out what is happened to your avatar.
I have tried this code
{ echo get_avatar($comment, $size = ‘65′, $email = “myemail@mydomain.com”); } ?> but end up with error message.
And I have tried this code too
{ echo get_avatar($comment, $size = ‘65′, $id = “04567a8d755566d2fe1289c5267ea983?s”); } ?> but end up with error message too.
I thought I did correctly but again I’m not sure what’s wrong with those two last experiments. And the weird thing is the error message appeared only when I edit and updating my old articles. And the second weird thing is, I didn’t choose any default avatar on the setting -> discussion , all I have to do is just Show Avatars on the Avatar Display and G — Suitable for all audiences on Maximum Rating part.
May be you can tell me what happened. But now I prefer the first step since it work and easy to apply.
UPDATE:
I realized that people who post a comment without or don’t have their avatar will be use my own avatar, like comment in this post.

Some Comments in this post has been removed to FREE BACKLINK page. If you can find you comment that mean we can removed it. You are welcome to post your comment again on FREE BACKLINK page.
@flash-player
Many Thanks
Gut!