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!!












awesome WP
yes, support for wordpress. great cms
I haven’t tried any gravatar before. Perhaps this one should be in the future
Yes…global avatar ( gravatar) is representation for online branding. So…make a good gravatar
oh.. I don’t know altought little php script, I can’t stand
I will try this one
Oh..really..
Akan saya coba…mudah2an berhasil..
Doa’in ya….sip
karena pakai wordpress.com ya saya terima jadi saja… nggak bisa ngapa-ngapain
I still used Brian Threaded comments and I’ll try your tutorial, thanks
gravatar is the rock
I use gravatar plugin, eventhough there is built in gravatar in wp 2.5+
i will use this gravatar plugin…thx
dont be mistaken. it’s just a code not a plugin.
Gravatar makes the comments more “human”….
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
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
Yeah me too, can you explain this fail, fatih? and maybe you can check it in here
nice work. but we have no problem about it in blogger. thanks
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?
Well i have an opposite problem. I couldn’t remove gravatar from my site though I already set it with no gravatar
Gravatar. Yeah, I am working on it..
Nah disini bisa muncul
hehehe
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?
Hey just stopped by. Going to read up and hopefully have something good to say.