Wordpress 2.6 Gravatar in Brian Threaded Comment

Posted on August 7, 2008 



It’s been quite a while that I wanted to have gravatars (aka Avatars) appeared in this blog’s Brian Threaded comments without using any plugins. Just a simple code. It should be possible considering Wordpress 2.5+ and 2.6 are gravatars built-in.  It took times to find a good lead since many tutorials are mostly focused on a non-Brian-threaded-comment. I’m also reluctant to use gravatar plugins as it’s a bandwith consuming.

I finally found a simple tutorial on how to do it and here’s the code:

Use this following code:

<div style="float: right; margin: 3px;"><?php echo get_avatar( $c, $size = '32' ); ?></div>

Between this code:

<div id="div-comment-<?php echo $c->comment_ID ?>" class='comment<?php echo $odd?>'>

and this code

<a name='comment-<?php echo $c->comment_ID ?>' id='comment-<?php echo $c->comment_ID ?>'></a>

Gravatars comment code for non-Brian-threaded-comment blog

If you’re NOT using Brian-threaded-commen plugins, putting the following simple code anywhere within the foreach and endforeach (the comments loop) shoud suffice.

<?php if(function_exists(’get_avatar’)){ echo get_avatar($comment, ‘50’);} ?>

To be more clear where the code position is see the image here.

Last but not the least, (1) don’t forget to enable the gravatars in your wordpress 2.5+ by going to Setting -> Discussion -> Avatar Display (click Show Avatar) -> Save Changes; (2) Put the code via wp theme editor -> comments.php -> Save Changes. (3) Never forget to have a backup before making any change.


Filed Under Blogger Indonesia   Tags: brian threaded comment, code, gravatars


Subscribe Blogger Indonesia by Email through Feedburner or Feedblitz newsletter!!







Comments










RSS feed | Trackback URI

What Do You Think?

26 Comments »

Comment by aminhers
2008-08-07 13:59:55

awesome WP

Comment by alhakim
2008-08-18 22:34:36

yes, support for wordpress. great cms

 
 
Comment by Ajakayakuwe
2008-08-07 15:30:45

I haven’t tried any gravatar before. Perhaps this one should be in the future :)

 
2008-08-07 16:04:16

Yes…global avatar ( gravatar) is representation for online branding. So…make a good gravatar

 
Comment by Hendrawan
2008-08-08 02:23:33

oh.. I don’t know altought little php script, I can’t stand

 
Comment by bowo
2008-08-08 23:10:44

I will try this one :D

 
Comment by silent
2008-08-09 00:25:52

Oh..really..

Akan saya coba…mudah2an berhasil..

Doa’in ya….sip

Comment by alhakim
2008-08-18 22:35:36

karena pakai wordpress.com ya saya terima jadi saja… nggak bisa ngapa-ngapain ;)

 
 
Comment by Arif
2008-08-09 01:23:58

I still used Brian Threaded comments and I’ll try your tutorial, thanks

 
Comment by Mario
2008-08-09 02:34:17

gravatar is the rock

 
Comment by kipas
2008-08-09 02:45:35

I use gravatar plugin, eventhough there is built in gravatar in wp 2.5+

 
Comment by sahrudin
2008-08-09 06:22:46

i will use this gravatar plugin…thx

Comment by Blogger Indonesia
2008-08-09 09:33:27

dont be mistaken. it’s just a code not a plugin.

 
 
Comment by Free E-books
2008-08-09 16:24:47

Gravatar makes the comments more “human”….

 
2008-08-11 06:38:44

I was about to download BTC and I stumble your article. Are you saying that with BTC, there will be no avatar?

Yan

#yes, unless you put the above code there`ll be no avatar even with wp 2.5+. infact it`s true to many wp themes

 
2008-08-11 07:36:40

Hmmm, for some weird reasons I couldn’t see the ‘Reply to this comment’ after the setup. These are two of the plugins I have failed to install, the other being popularity contest plugin.

Yan

Comment by Muhibbuddin
2008-08-31 16:33:32

Yeah me too, can you explain this fail, fatih? and maybe you can check it in here

 
 
2008-08-26 15:34:01

nice work. but we have no problem about it in blogger. thanks

 
Comment by Muhibbuddin
2008-08-31 16:24:11

Dowh… somebody help me. can i put this plugin in wp 2.6 in default theme? I can’t use it in my blog, or i’m missing some thing? :-?

 
Comment by Silo
2008-09-04 17:36:21

Well i have an opposite problem. I couldn’t remove gravatar from my site though I already set it with no gravatar

 
Comment by monaye
2008-09-23 01:04:24

Gravatar. Yeah, I am working on it..

 
Comment by dikma
2008-10-21 14:35:38

Nah disini bisa muncul
hehehe

 
Comment by sheridan
2008-10-30 03:40:33

My son knew he needed to stop smoking. He’d just seen his father die at 38 from lung cancer. That was the spark that made him realize that smoking could literally kill him. Unfortunately, every time he tried to stop, he would yield to temptation within a few days. I looked at using a nicotine patch and nicotine gum, but didn’t want him to use either. For me, it seemed silly to take the same substance that causes the addiction – nicotine.
I searched for a natural and safe method to quit smoking: http://freshnewsday.com/stop-smoking.html
How it works?

 
Comment by Leeann1970
2009-01-19 08:55:33

Hey just stopped by. Going to read up and hopefully have something good to say.

 
Your Name: (required)
Your E-mail: (required - never shown publicly)
Website:
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.
Comments are welcome in the following languages: English, Arabic, Bahasa Indonesia, Boso Jowo and Cak Madureh. A link within a comment will make it automatically moderated.

Blog Responses to this post: