Twitter Avatars In Comments WordPress Plugin
Over the last months, Twitter has become extremely popular across the Web, with more blogs, magazines and companies using it to communicate with their audiences and customers. Even we started Twittering a couple of months ago and have over 3,650 followers now. Please feel free to join us and follow Smashing Magazine on Twitter
as well.
Although we aren’t sure if Twitter will actually revolutionize blogs (as other blogs claim), Twitter is definitely changing the way website owners communicate with their visitors, and we, designers, need to be aware of that and use appropriate tools to meet the expectations of our clients. Unfortunately, there are not that many plug-ins and extensions for Twitter out there, so we decided to release one: the Twitter Comments WordPress Plug-In.
Twittar WordPress Plugin
The objective was quite simple: create a plug-in that uses Twitter to show avatars in comments in WordPress blogs. But after discovering the potential of the Twitter API, the plug-in evolved into a complete “avatar for comments” solution for WordPress. The plug-in was developed by Ricardo Sousa, a young designer with a strong passion for WordPress and Joomla!.
Features
- Loads user’s avatar by matching the email address to the user’s Twitter email address.
- If user doesn’t have a Twitter account, it first tries to load user’s gravatar. If user doesn’t have a gravatar, it loads a default image. This is an optional setting.
- You can set a 2-pixel border to the images (you choose the color).
- You can choose the size: we suggest 24, 48 or 72 pixels.
- You can set an image other than the default one to load if a user doesn’t have a Twitter account or a gravatar.
- It builds a valid image for you (with alt and title attributes, etc.) based on user details.
- Allows you to add a class to the image, so you can style it later.
Download the plugin for free
The plug-in is released under the GPL. You can use it for all your projects for free and without any restrictions. Please link to this article if you would like to spread the word. You may modify the plug-in as you wish.
- download the plugin (.zip, 9 Kb)
Installation instructions
- Copy the “twitter” folder to your plug-in folder (wp_root/wp-content/plugins).
- Log in to your WordPress administrator panel, and activate this plug-in (click “Plug-ins” and then “Activate” near the plug-in title).
- Now you will need to edit your template’s comments.php file to show the avatar near the user comment.
- Click on “Appearance” and then “Editor” in your WordPress back end.
- Choose comments.php or comment.php or the PHP file that manages your user comments.
- Find the lines where the template manages the comments, and add the following line where you want to show the user’s avatar:
<?php twittar(size, placeholderimg, border, class, usegravatar, rating); ?>Note: You may need to change your template. If your template already supports gravatars in comments, you will need to delete the gravatar tag and add twittar. You may need to make some adjustments in order to show the avatar properly.
You must change the values inside
twittar();. Here’s how:size
The size of the avatar (in pixels). Just insert the number (e.g. 45), without “px.” It is the size for both width and height.placeholderimg
The URL for the image you want to use when the user has neither a Twitter account nor a gravatar. Must be inside quotes (“”). Optional.border
The color for the 2px border. Insert the hexadecimal code of the color (e.g. “#FFFFFF” with the “” marks) but only if you want to use one.
class
A CSS class that you want to use to style the avatar. For example: “myimg.” In the CSS, you would include.myimg { }. Put inside “”.usegravatar
Just insert 1 if you want to use gravatars, and 0 if you don’t. If you choose to use gravatars, it will try to load a gravatar image if a Twitter account and picture is not found, otherwise it will load the placeholderimg (default) image directly.rating
Parameter for gravatars only. Read more at www.gravatar.com.Note: if you want to skip a parameter and add another in front of it, just replace it with “”.
Example:
An example configuration could be:
<?php twittar("45", "", "", "myimg", 1, "R"); ?>Recommended sizes for images: 24, 48 or 72 px.
- Save the file and enjoy Twitter avatars (see the image below).
Please feel free to post questions about installation in the comments.
About the author
The plug-in was developed by Ricardo Sousa, a young designer with a strong passion for WordPress and Joomla!. You can follow him on Twitter.


Blogging2U
January 8th, 2009 5:13 amNice! Never seen anything like this before. Thanks for the plugin. I think plugins is kind of new category for freebies in SM, right?
Vitaly Friedman & Sven Lennartz
January 8th, 2009 5:22 am@Blogging2U (#1): that’s correct, we are going to try a number of different things in January.
Lee Munroe
January 8th, 2009 5:26 amWow, great idea and great job Ricardo! There’s loads of Twitter users that don’t have gravatars so this could be very useful.
XIII
January 8th, 2009 5:39 amNice plugin, I still get a lot of comments from people who don’t use Gravatar but do use Twitter.
Markus
January 8th, 2009 5:40 amGreat ideas! Both the Twitter avatars in comments plugin as well as plugins from Smashing Magazine in general.
Ricardo Sousa
January 8th, 2009 5:48 amThank you Smashing for publishing this plugin and users for the good comments you have been giving. :)
Mohsen
January 8th, 2009 5:58 amThanks for releasing this great plugins. fantastic idea!
Andre
January 8th, 2009 6:04 amVery nice job! Thanks!
enzo
January 8th, 2009 6:13 amgenius. been waiting for something like this for a while now. love that it’s inclusive of gravatar and doesn’t outright replace it.
ciao,
‘enzo
–
http://twitter.com/_enzo
brtak
January 8th, 2009 6:17 amNice work, keep smashing :-)
Jhay
January 8th, 2009 6:20 amLooking good. Thanks SM!
Chris W.
January 8th, 2009 6:38 am@Vitaly, that is an interesting approach. What happens if Twitter is down, it just finds the gravatar instead?
Phill Price
January 8th, 2009 6:38 amGreat work – this and Tweetbacks will be awesome
Noam
January 8th, 2009 6:42 amThat’s great!
TNX!
Bella Casa
January 8th, 2009 6:42 amI wish I were so talented as to actually understand these instructions ;)
Very cool concept though!
I do have Gravatar, so I guess I will stick with that for now.
Bella
Bella Casa blogs
Karolis Pocius
January 8th, 2009 6:49 amSounds nice, but here’s what I get after activating it and placing the code:
Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /public_html/wp-content/plugins/twittar/twittar.php on line 178
PomCompot
January 8th, 2009 6:50 amVery nice idea to get multiple avatar providers. Icons, fonts, textures, and now plugins, I like this renewal. Smashing is really a valuable resource on the web.
IC
January 8th, 2009 6:50 amLooks cool. I’m going to give it a try.
Raphael Camaprdou
January 8th, 2009 6:52 amIn the same spirit, @tsaots created a WP plugin that greets you with your Twitter name. More info here.
Neat concept, that can be developped:
Why not greet the user via Twitter:
“Hi Jon, I hope U enjoy reading my site. ++”
Michiel
January 8th, 2009 7:07 am@Karolis Pocius: yes, you will need to have cURL (libcurl) support in your PHP for this to work. You might try asking your host for this. If you have a dedicated server, installing it should be easy.
Desire Dupas
January 8th, 2009 7:14 amSeems to work ! Great !!!
Rene
January 8th, 2009 7:27 amNice? Does anybody find Twitter not cool? Like me?
Sal Azad
January 8th, 2009 7:33 amgreat…. another great stuff from smashing magazine… thanks!
Merchndise
January 8th, 2009 7:40 amThanx! Will give it a go.
Chris Heilmann
January 8th, 2009 8:20 amThis is quite nice, but the performance of it is utterly terrible. For each comment you will have two http requests server side and then one client side to load the image. This could perform a lot faster if you do the lot client side (going through a PHP proxy) and delay the display of the image until the page has finished loading. That way you don’t punish users that really don’t care too much about avatars but deliver quickly.
Marco
January 8th, 2009 9:33 amI agree with Chris that the amount of http requests this results in is unacceptable. I would however build in server-side caching. This will result in the best client side performance and it will also result in less load on the Twitter servers. That way everyone wins.
Mediumjones
January 8th, 2009 9:53 amWicked! too bad Smashing isn’t using this plug-in :P
Ricardo Sousa
January 8th, 2009 9:59 am@Chris Heilmann (#25) & @Marco (#26):
Yeah. I thought about that too. However i wasnt able to come up with good solutions. I liked yours and will work to implement them :)
@Chris W. (#12):
Yes it will load gravatar instead.
@Bella Casa (#15):
Thanks. Anything i can help you with about instructions?
Hope you enjoy it anyways.
Thanks
Timothy
January 8th, 2009 11:35 amAnyway this could work by Twitter name and not by email address?
Chris Wallace
January 8th, 2009 11:37 amHow secure is the cURL usage in this plugin? Reason being, it could be a problem for non-techie bloggers that just “want twitter on their blog.”
Ricardo Sousa
January 8th, 2009 12:47 pm@Chris Wallace (#31):
Can you explain better what you mean? :)
Thanks
Kristen
January 8th, 2009 4:04 pmI just tried to install the plugin on my WordPress blog. Everyone who had a Twitter profile image just showed up as “Image Not Found”. It was trying to pull the images from myblogdirectory/_bigger. Pretty sure that isn’t right. Everyone who had only a Gravatar icon showed up okay. What gives? Do I need to change some code somewhere in order to get things working properly?
Michael
January 8th, 2009 4:06 pmLove it – will be implementing asap.
Mitch_Nash
January 8th, 2009 4:07 pmThanks – appreciate it.
Ricardo Sousa
January 8th, 2009 4:13 pmKristen (#33):
If it is getting the images from your blog it isn’t (but remember that user must input the twitter mail :) ). So if you don’t mind can you share your blog adress so i can check?
Thanks
bradyG
January 8th, 2009 4:40 pmNice plugin. Works like a charm.
Alex Ch
January 8th, 2009 6:42 pmBrilliant :)
Thanks
Alex
Laura
January 9th, 2009 12:33 amCool idea. You could potentially extend this to other avatar services, and have an admin menu for specifying an order of preference that the avatars appear in – like some people might prefer gravatars over avatars.
Think I’ll wait til a later version, based on some of the comments, but awesome work!
Carlos Guadián
January 9th, 2009 12:40 amTesting…
Ricardo Sousa
January 9th, 2009 3:30 am@Laura (#39):
Sure. I will add a couple more of things including the improvments in the global plugin way to do things so it can be more efficient. Thank you for your suggestions.
Best Regards
Omair Rais
January 9th, 2009 3:43 amI don’t know why peoples use twitter?…
Anyways Thanks for sharing.
Regards
Omair Rais
http://www.omairarts.com
Simon Scullion
January 9th, 2009 3:57 amLove the idea!
However I am reluctant to have to modify my templates. I’d much prefer something I could configure via the admin panel.
Would that be possible?
Simon Scullion
January 9th, 2009 4:16 amAlso, could it not use the twitter username rather than an email address?
Check out http://chinposin.com/ for more twitter avatar madness, you might be able to tie into that somehow too!
wannesdeloore
January 9th, 2009 4:20 amcool! and nifty.
Daniel
January 9th, 2009 4:58 amVery nice plugin, and good post. :)
Youri
January 9th, 2009 6:32 amThis is genius because it limits the amount of default avatars in your comments without forcing your user to fill in an extra form field. Excellent release!
Ricardo Sousa
January 9th, 2009 7:47 am@Simon (#43):
Sorry but it must be implemented throught Template the way the is right now. I will try to make something sweet that let you add it as a wordpress default avatar system so new wp themes already support without hacks but right now that is the way it works. Anyway you shoulnd’t be worried. Those are not risky hacks.
Regarding username: It could but for me it doen’t make much sense because you would need a extra input field which is unnecessary. Anyway if you would like it drop me a mail throught http://www.ricardojrsousa.com
Best Regards
Kristen
January 9th, 2009 9:49 am@Ricardo (#36)
Sure thing — here’s an example of an entry w/comments:
http://kristenbyers.net/blog/?p=2198
As you can see, people with only gravatars work just fine, Twitter avatars are MIA, and those with neither have the placeholder.
Baturalp
January 9th, 2009 12:24 pmThis plugin looks nice, when I examine the code, however, I realize that it sends a query per comment to the Twitter server. Did you know that Twitter only allows 100 request per hour. So if any post that has 20 comments is visited by 5 people than Twitter will block my web server for that hour period. Therefore this plugin is not usable right now. The plug-in must cache twitter avatars or urls for each email address, probably in database. You need to work on it Ricardo, it is useless now.
John Faulds
January 9th, 2009 2:25 pmIt would be good if the plugin could be modified to cater for both inline and background-images.
Ricardo Sousa
January 9th, 2009 3:26 pm@Kristen (#49):
Will try to understand what is the issue and will get back to you.
@Baturalp (#50):
Frankly i didn’t knew that but as i said in reply to previous comment i recognize that this is not the most efficient way even it being “a way”.
I will add cache support to it ASAP.
@John (#51):
Is a idea :) Can be worked out. The main idea of the plugin was to be “as simple as possible” but it can be improved to get better performance and more options. I’m working on it ok? :)
Best Regards
hoshiyuki
January 9th, 2009 10:24 pmnice!
Regravity
January 10th, 2009 6:16 am@Ricardo Sousa – Great idea for a plugin, to extend on what Baturalp was talking about it would be good to add in database support so that while twitter is up and accepting links.
The biggest issue that you will have is that people change their avatars on a regular basis so even if you cache or database the images, you will still have issues with updating each avatar when a twitter user changes it.
Here is what I propose, because Twitter allows the 100 per hour API request you could initially grab the images for user comments (as requested from page views) as it does now, insert them into the database then set a part of the script to either incrementally grab the commenter images again over midnight (local time to the server wordpress install) in 100 user at a time blocks (this is inefficient) or to have the plugin re-grab the commenter image on next post (which is much more efficient and puts less load on twitter and web server).
Of course the latter would also need to be described as a limitation due to twitter’s current API allowances.
The third option to yourself is talk to Twitter…
Because you aren’t requesting the actual IM text from a tweet and only grabbing the image for a specific twitter user they may work with you to come up with a more viable solution (they have done this in the past).
All I can say it is an awesome start and good luck in updating it!
isabela
January 10th, 2009 7:53 amVery nice plugin !
Baturalp
January 10th, 2009 8:09 amI should include that “cache” does not mean to save a piece of information forever, contrarily it should save information for a limited period of time, like @Regravity said. Because original data might change in time. Therefore you should decide the timeout period for caching, which must not exhaust people’s web server. On the other hand, you should treat nice to twitter’s servers. :)
Good luck!
JC Place
January 10th, 2009 12:34 pmGreat plugin, thanks alot.
karl prosser
January 10th, 2009 1:42 pmtesting to see if this does work
micmerty
January 10th, 2009 9:56 pmsuper dooper … downloading now!
Aaron Proctor
January 10th, 2009 10:10 pmThe showUser() requires an e-mail address, but trackback comments without e-mail addresses pull up someone’s Twitter avatar. Adding a check for this on line 34 fixes the problem.
aNieto2k
January 11th, 2009 4:29 amIf you use the filter ‘get_avatar’ and this code, you dont need to modify your comments.php code.
function change_get_avatar($avatar, $id_or_email, $size, $defailt, $alt){
if (function_exists("twittar")) {
twittar($size, "", "", "myimg", 1, "R");
return false;
} else {
return $avatar;
}
}
add_filters('get_avatar', 'change_get_avatar');
If you have Twittar plugin active you use the Twitter Avatar and if not active you use
get_avatar()function.Ricardo Sousa
January 11th, 2009 9:41 am@aNieto2k (#61):
Thanks. After release that first version i found that and is added on top of version 2.0 that will be released soon with new features and total controll of settings from backend. Anyway this tip is only valid to recent templates. Must of them don’t even use gravatar neither the get_avatar function.
I will add all the options and change the documentation.
Thank you very much.
I will reply to other questions as soon as i get home as i am out right now.
Thank you all and wait while i talk to twitter regarding the newest versiont that i promisse will be much better.
Ricardo
Goyal
January 11th, 2009 9:52 pmAwesome plugin – thanks!!
Ricardo Sousa
January 12th, 2009 5:33 am@Regravity(#54) & @Baturalp(#56):
Regarding your informations i’m thankful for them.
I’m working with twitter (i mailed them) in order to find a solution. Cache will be added (actually it is already added) but the question here is to find an efficient way to make the updates. I’m thinking about create a dummy twitter account. Login will be encrypted and we log on twitter before doing the updates. This account will have (i’m hoping) no limits or better ones.
So the plugin will load the img adress when the user make the comment and then update in a certain date & time. The big question here is if i can know remotly when the photo is updated. Working on better solutions and willing to hear from you users, as we speak.
Thanks
nAODI
January 13th, 2009 12:32 amThis sounds cool !
Denis
January 13th, 2009 3:16 amI have made a litter modification for this plugin to have database support.
Ricardo Sousa
January 13th, 2009 5:51 am@Denis (#66):
This will be added in the next version. Would you like o share with me what you did? if so please mail me to blog[at]ricardojrsousa.com just to see if is different from mine.
Kristen
January 13th, 2009 4:35 pmI still can’t get the plugin to work on my blog, no matter which theme I use. Is it possible that Twittar isn’t compatible with another one of my plugins?
Conorp
January 14th, 2009 2:11 amIs there anyway this could work oppositely, It try’s to load gravatar first and if it cant it uses twitter?
Cristian Castellari
January 14th, 2009 5:19 amI’m having a trouble. I set the plugin correctly, but the placeholder image for a users that has not twitter or gravatar is still the gravatar default.
I want use a custom placeholder image and gravatar too compatibility. The params i use are the followings:
twittar(48, “http://www.skyflash.it/wp-content/themes/freshnews/images/gravatar.jpg”, “#cccccc”, “gravatar”, 1, “”)
Ricardo Sousa
January 14th, 2009 12:15 pm@Kristen (#68):
Excuse me. I’ve been a little busy lately so i completly forgot to get back to you. Are you willing to create an admin (temporary) acccount and send me the details to blog[at]ricardojrsousa.com so i can test in on place and see what is wrong? If so please do it otherwise please post here the exactly code you copied into your comments.php file and confirm that the user for which the default avatar is being given has a twitter account. I can see that there are a user which has the gravatar img so if there are a problem should be with twitter.
@Conorp (#69):
I’ve been debating myself with that question. Should i do it or not? Will it be against the initial intent of the plugin? The awnser is yes but i think user should have the option to choose so for the next version this feature will be added. (Totally redisigned params and code). So just way some more days (Check bellow)
@Cristian (#70):
May I have your site adress? If you think it’s better plz mail me to blog[at]ricardojrsousa.com with all the info you may be able to provide.
NEW VERSION:
Regarding the new version. I’ve been today trying to contact Twitter team so i expect to release the new version within a week. Actually it should be earlier but better give myself a 1 week timeframe. You want more info regarding what exactly it will have improved? Mail me blog[at]ricardojrsousa.com and i will be more than happy to provide you with that info.
Best Regards,
Ricardo Sousa
Cristian Castellari
January 15th, 2009 1:20 am@Ricardo: sure! Mi blog is http://tinyurl.com/7n7h6c
For better explanation, i left both images:
the first column is the gravatar built on the blog template. You may see the default icon i’m using and some gravatar users.
The second column is the twittar plugin. You may see some icons from twitter users AND a gravatar default icon which is not that i declared in the plugin activation code.
If i use “0″ instead of “1″ in the usegravatar option, the default icon is good, but i lose the gravatar compatibility
P.S.: may i suggest an “alt” function in the plugin, wich displays a message like “Come see my $twitterprofile and follow me!” when the mouse hovers the icon?
WP Cult
January 15th, 2009 11:13 amThat is really awesome, I really like this idea!
Cristian
January 15th, 2009 1:41 pmSolved! Was a my mistake! I’ve forgot the ” ” for the size parameter.
Ricardo Sousa
January 16th, 2009 6:49 am@Cristian (#74):
Sorry for delay. Glad you solved!
All other issues:
i will be out for the weekend but will get back to them ASAP.
Ricardo
Kristen
January 16th, 2009 10:42 am@Ricardo (#71): Just figured out the problem this morning! I finally figured out how to upgrade my host to PHP 5.0 and it solved a few minor problems I was having. Might be useful information for troubleshooting other users in the future.
The plugin is working great now, thank you!
DoctorFu
January 17th, 2009 7:36 pmSo is there a future update coming out to use “alt”?
Ricardo Sousa
January 19th, 2009 6:12 am@DoctorFu:
Hope to have one till the end of the week.
Cheers
Rogov Dmitry
January 23rd, 2009 5:00 amNice, tnx
borism
January 25th, 2009 9:23 amThank you very much for this interesting Plug-In. I think, I`ll try it out.
Greetings
Boris
Nicolas TAFFOREAU
January 26th, 2009 3:04 pmNice plugin, thank’s ! But i’m using Gravatar.
Nneon
January 28th, 2009 5:08 pmI’ve installed the plugin but am unable to get the twitter avatars to show up…
The default and gravatar images work… the twitter ones do not.
I’ve tested this by changing my email address on one of the comments to match my email address used on twitter.
I’m also using php5
Any ideas on what could be wrong?
Dave
February 1st, 2009 10:16 amDoes this also give the user the option to send a tweet with the comment at the same time – nice plugin
disklayekly
February 10th, 2009 7:38 pmfascinating and informative, but would make something more on this topic?
Joe Brooks
February 17th, 2009 10:48 amIs this compatible with WordPress 2.7?
I only have 50)); ?> in my comments.php that refers to avatars.
Please make it compatible with WordPress 2.7 :)
Jesse Friedman
February 27th, 2009 6:04 amThis plugin is great. It was working under WP 2.7 but no longer works under WP 2.7.1 Any intentions on updating it?
Suz
March 1st, 2009 8:12 pmI was wondering how this plugin might work with themes that use the wp_list_comments() function instead of legacy comments. I can’t figure out what to edit in order to insert the Twittar code.
Jorin Cowley
March 5th, 2009 2:46 amAre you using this plugin?
Michael SteelWolf
March 5th, 2009 5:40 amSame question as Suz above.
Tom Graham
March 6th, 2009 6:35 amCool
Masey
March 7th, 2009 9:57 pmI can’t see how to make this plugin work using WordPress 2.7.1.
The only lines of code I can find for comment templates in my theme’s comments.php file are as follows:
php wp_list_comments('avatar_size=60&type=comment');
I can’t do anything with that????
The only place I have found to actually alter the layout/styling of the comments is in the wp-includes/comment-template.php file. If I add the Twittar code to that page it doesn’t work, presumably because it is outside my theme folder, and breaks the Blog code.
Surely someone else has run into this problem?
If it helps, I’m using the “Gazette” Woo Themes” theme.
Any help would be greatly appreciated.
Travis
March 31st, 2009 9:57 amIs this plugin still being developed?
Terrance Charles
April 2nd, 2009 10:50 amPerfect, hell of a great post, I needed this. Going to add it to my blog now ;-)
Terrance Charles
Paul Pichugin
April 2nd, 2009 9:08 pmLooks like a great plugin, I’ll be using it on my site soon :-)
yugom
April 3rd, 2009 3:33 amthanks…
joe
April 5th, 2009 8:57 pmyeah!
Jason
April 9th, 2009 9:22 amI don’t think this works anymore. Is there an alternative?
The email parameter has been deprecated
/users/show/show.xml?email=xxx@xxxxxx.com
John
April 17th, 2009 9:01 amI really like this idea, but can’t get it work on my site with wordpress 2.7.1. Any plans for an update?
Montana Flynn
April 19th, 2009 3:30 pmHow about a register to your wordpress blog plugin? Throw in a checkbox says “log in from twitter” click opens up a button says connect from twitter. You click, it opens oauth, you accept. Your registered. Now your comments show up with your avatar and you can retweet from the comments form.
Jagadish
April 21st, 2009 4:36 pmGreat idea. Have to see it working to say more.
Gert Hough
April 28th, 2009 11:16 amHaha – I just needed to add a comment on this post as I think it would be great running it on my blogs. If I can get it to work :-) And off course for the fun seeing it in action. Great idea Ricardo – and thanks for having worked at it.
Super Gab
May 3rd, 2009 6:44 pmHi, I just can’t make it work. It gets the gravatar image but not the Twitter image.
Pinto
May 8th, 2009 11:28 amHi,
Great plugin but i have some error with it.
after installing the plug in i have add the code line but got this error:
Parse error: syntax error, unexpected T_CLASS in /wp-content/themes/Digital-Statement/comments.php on line 26
and line 26 is thae line the you have told to add here.
Please help.
Thanks
Chris
May 11th, 2009 1:31 pmThis could be an interesting addition to the blog. I’ll check it out some more. Does it slow down the blog page load at all?
Chris
May 11th, 2009 1:32 pmIt didn’t work for me. It should grab my twitter icon based on email address, right?
ervin
May 13th, 2009 12:35 amFantastic…gonna try it
Dan Y
May 14th, 2009 2:58 amForgive me for wasting your time but I am eager to get this plugin working and can’t manage it. I think I need to be walked through these two tasks:
1) Exactly where to insert line in comments.php
2) How/where to find/delete gravatar tag.
Sorry to be such a bother and dummy. But the help would be greatly appreciated.
Best,
Dan
Best,
Dan
Tolga
May 15th, 2009 8:37 amthank you, that is exactly what i was looking for
Boloo
May 21st, 2009 11:49 pmThanks a lot, i´m trying it i my blog :P
Luc
May 29th, 2009 1:29 pmIs it magic ?
Kay
June 5th, 2009 7:19 amAny plans on updating the plugin? It would be awesome.
yinin
June 17th, 2009 6:15 pm我试验一下
tasarhane
June 21st, 2009 9:36 amits pretty useful.. thanks
Valk de Joost
June 27th, 2009 12:43 pmWarning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/user/public_html/wp-content/plugins/twittar/twittar.php on line 178
And you haven’t bothered to update the plugin since January, despite promises to the contrary.
FAIL.
eliezer
July 8th, 2009 12:23 pmit sucks that * I * can’t find where to insert:
):
I installed a theme called modularity and I can’t find the comments template. Shit.
Any ideas?
eliezer
July 8th, 2009 12:27 pmYEAH! I’ve found it buut now my Twitter avatar is not being displayed. ¬¬
eliezer
July 8th, 2009 12:31 pmas a matter of fact no twitter avatars are being shown. : O
I copied the folder via FTP to the plugins folder, I activated the plugin through the wp-admin, and then I changed this line in comments.php:
twittar(“75″, “”, “”, “avatar avatar-75 photo”, 1, “R”); //echo get_avatar( $comment, 75 );
Help? This plugin seems to rock. What do the users have to put? The twitter registration email address or something?
eliezer
July 8th, 2009 12:46 pmIt’s working because if I set the “usegravatar” parameter to (int)0 I don’t see a friend’s avatar, but if i set it to true boolean way I do see her gravatar, but it’s not her Twitter avatar.
I used my email in a comment but my Twitter avatar is not displayed.
eliezer
July 8th, 2009 12:50 pmIf i do the XML request directly from my browser to Twitter I get:
/users/show/show.xml?email=john@twitter.com
The email parameter has been deprecated
Isn’t Twitter accepting email as parametters anymore?
eliezer
July 8th, 2009 12:57 pmI just realized your plugin is not going to work as long as Twitter doesn’t want to take that parameter.
USELESS. sorry to say that.
eliezer
July 8th, 2009 1:00 pmdude, let’s try to do it some other way, I’ve found this information for you:
http://code.google.com/p/twitter-api/issues/detail?id=411
Key is here now:
http://twitter.com/users/username.xml
eliezer
July 8th, 2009 1:08 pmYou know, I could just change your plugin name and keep all the credit, but here’s your fix bro!
Find in wp-content/plugins/twittar/twittar.php and change this:
function showUser($id){
// Will arrange the url we need to open @ twitter to get the photo info
$request = 'http://twitter.com/users/show/show.xml?email='.urlencode($id).'';
// Will open another function that will do all the hard work :)
return process($request);
}
for this:
function showUser($id){
$id = explode('@', $id);
$id = $id[0];
// Will arrange the url we need to open @ twitter to get the photo info
$request = 'http://twitter.com/users/'.strval($id).'.xml';
// Will open another function that will do all the hard work :)
return process($request);
}
Links or credits are welcomed. ( :
Now, we can specify in a Label something like..
Email (to use Twitter enter youryoursername @twitter.com)
And then everything will match.
eliezer
July 8th, 2009 9:38 pmdude, lol…
you’re not gonna show my contribution to your script???
it didn’t work until I showed you how, you know? Be FAIR.
ruud
July 12th, 2009 10:53 amHi,
Tried this above but the Twavatar plugin works easier.
matt
July 13th, 2009 9:52 pmI was wondering if anyone has tried Twittar on the Magazeen theme that Smashing released recently. I can’t seem to get this to work. I am sure it has something to do with the magazeen_comments function, but I have no idea what. Thanks for the help!
john
July 23rd, 2009 6:20 amHas this been setup on the smashingmag blog? I’ve just posted my comment here using my twitter email. fingers crossed
it didn’t work :(
Ricardo Sousa
July 23rd, 2009 12:02 pmHello,
I’m sorry for so long-time with no replies for you all.
I’ve been dealing with some personal issues that come into the way and drove me away from development work.
I’m now quite “Back to Work” and I’m ready to present the version 2 of this plugin which will not only fix tons of the issues reported but also present a more efficient way to get the avatars. This version is already ready but need some testing and fixing prior to release.
I’m going off for a week or so to enjoy some (deserved) vacations. Then I will be releasing 2.0 version of Twittar ;) The fix eliezer presented should work just fine in the meanwhile.
————————————————
READ THIS:
Now the important part:
Whoever mail me at: blog@ricardojrsousa.com within next week will be not only the first to receive Twittar2 but will also get free install of the plugin. Yes, I’m installing twittar in each one of your websites on your request.
If you do not wish the install but just the plugin you can tell me that on the mail…
As soon as i get back I will start those installations as my primary to-do.
Twittar2 will be released in this page for everyone else in the 5 days following the 1st hand release for those who mail me.
————————————————-
Some new about Twittar2:
- Now include backend;
- No need to edit que comment.php file anymore;
- Stores avatars for better managing;
- Options to refresh avatars ;)
- Many more settings;
- Linking to twitter when click the avatar will be possible;
- and more…
Thanks!
I hope you can forgive me ;)
Ricardo
Eric Martin
July 24th, 2009 8:18 amGreat idea – too bad it doesn’t work!
The email parameter has been deprecated: Test for yourself
It will only work if you can capture the user’s twitter username/id/screenname in addition to their email.
NovRain
July 30th, 2009 9:07 amYEAH! I’ve found it buut now my Twitter avatar is not being displayed. ¬¬
Andres
August 3rd, 2009 2:03 pmWhat if I have both Gravatar and Twitter?
(EDIT-> shows Gravatar)
josh
August 6th, 2009 7:49 pmwill you be able to get this to work again?
André Câmara
August 10th, 2009 3:22 pmtest
Boloo
August 24th, 2009 4:20 amI think this is not working
wartoon
August 26th, 2009 7:27 amWhat does this use?
tamilsweet
September 9th, 2009 12:24 amThanks!!!
Thomas McGregor
September 24th, 2009 4:38 amHey,
I have actually just created a WordPress plugin that does exactly what’s described above, but circumvents the problems with the above plugin since Twitter changed their stance on allowing to search by email address.
You can find it here http://wordpress.org/extend/plugins/twitter-avatar
Let me know what you think, cheers,
Thomas
Abel Braaksma
October 2nd, 2009 11:42 amIf I understand you well, this plugin shows the Twitter image when you have both an Avatar and a Twitter icon. I figured you would use this yourself on this blog, why don’t you? At least it seems that you don’t use it here (no links, no mouseovers with info). EDIT>>> Avatar icon is used on this site instead of Twitter, but not sure its the same plugin here
Hint: there are also plugins that can take @yourname and auto-turn it into a Twitter.com/yourname link, as with @Kandura (my twitter name).
I like this plugin, thanks!
Robson Niedson
October 7th, 2009 7:03 ammuito legal isso! verry good! where are my pic of twitter here?
WelcomeToTheSky
October 8th, 2009 6:50 amGreat, I get it :)
jerome robins
October 14th, 2009 3:24 pmtesting
jerome robins
October 14th, 2009 5:14 pmi cant get this thing to work….i have to put it on my functions.php page instead…is this right?
plus when i did it, it didnt work :(
Gemma Wild
December 29th, 2009 2:50 pmHi Jerome
Ignore the instructions found in the following article: http://wp.smashingmagazine.com/2009/03/04/15-useful-twitter-plugins-and-hacks-for-wordpress/ (I’m assuming this is where you got your info to copy all the code from twittar.php file to your themes functions.php file as I did the same and it does not work).
Just activate the plugin in the normal way and add the given php code to your comments.php file (as stated in the readme.txt file that comes with the plugin) then you will find it works perfectly.
Gina
October 16th, 2009 5:48 amTesting to see how it all turns out .
singh
October 19th, 2009 7:55 amlets see
Jimmy Liew
November 12th, 2009 9:12 amThat is great! It really helpful
BLOGBloke
November 16th, 2009 3:01 amIs there any way to make it work with the WordPress Thread Comment plugin? The avatar doesn’t show up in the reply thread.
..BLOGBloke
offsetik
November 30th, 2009 1:02 amОчень нравится.
Gemma Wild
December 29th, 2009 2:16 pmHas anyone else reported that this ‘hack’ appears to conflict with ALL other plugins installed on their blog? I received the following error once I added the code to my functions.php file:
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/—-/public_html/wp-content/themes/—-/functions.php:7) in /home/—-/public_html/wp-content/plugins/*pluginname*/*pluginname*.php on line 1966
I tried de-activating plugins to see if it was specific ones but the same error was always present, just with the next plugin instead.
This looks like a great plugin so any ideas what the problem is and how it can be resolved?
Thanks! Gemma
Mattias
January 3rd, 2010 3:00 amSadly, it doesn´t work. Tried Elizers workaround with WP2.9 and it´s a no go. It sure picks upp a twitter avatar, but it isnt the right one.
When I look in the author profile for that comment I get the correct url to the avatar, but somebody elses is used in the comments field.
This is what is picked up in the comments: http://a1.twimg.com/profile_images/19932962/Photo_5_normal.jpg and this is the url in the author profile for that comment: http://a3.twimg.com/profile_images/560114545/parkering-forbjuden_bigger.jpg (the one it should be)
Ricardo seems to be on a long vacation, since there hasn´t been any updates yet.
Athena
January 3rd, 2010 7:10 pmAn update for WP2.9 would be great. Otherwise, this is dead in the water :(
Violet
January 5th, 2010 10:22 amI’ve come across a small handful of blogs that use something similar, only it allows you to sign in using either A) Gravatar B) Twitter C) Facebook or D) OpenID (I think)
And I can not for the life of me remember which blog it was I used it last on… I’d like to find this so that I can use it as well.
Any ideas???
Usdating
January 10th, 2010 2:30 pmVery very usefull info. I think this is a ‘TOP1 Article into Build Link Popularity. Keep going!
ejaz
January 14th, 2010 6:07 amtesting testing
ejaz
January 14th, 2010 6:38 am?????
Jamie Bicknell
January 28th, 2010 5:41 amThis doesn’t work due to changes in the Twitter API.
The script tries to find Twitter account information via:
http://twitter.com/users/show/show.xml?email=email@address.com
However, Twitter have stopped allowing searches based on the email address, so therefore this sadly can no longer be done. You can however use the following URL to grab the Twitter avatar based on the screen name, but you will need to ask for this information from the user in the comment form. See this URL:
http://twitter.com/users/show/show.xml?screen_name=jamiebicknell
Antonio Bustamante
February 7th, 2010 7:11 amJamie is totally right, the parameter ‘email’ was deprecated in the Twitter API, and there is no practical way to do it. You could try to perform a ‘search’ according to the nickname of the visitor, but that requires authentication. It’s a shame, but I guess spammers found a way to take advantage of that feature.
My suggestion is that Smashing Magazine should modify the plugin for it to work at least with Gravatar (but you don’t need a plugin for that)… so maybe a small warning message to the visitors regarding this situation?
Best WP Plugins
February 22nd, 2010 2:03 pmCan you provide more information on other wordpress plugins, or do you have some resources you can share with us where we can find such useful stuff? Thanks.
engns
March 12th, 2010 11:31 amthank youuuu saolun
wesley
April 27th, 2010 5:36 pmthanks!
x0o
June 23rd, 2010 3:03 pmthankyouuu
kase
June 24th, 2010 12:40 pmworks?
Bruno
July 4th, 2010 1:50 pmNem funciona :/ Don’t works
LinkinnShadow
July 6th, 2010 6:59 amDoes Smashing Magazine use this method?
Renato Andrade
July 7th, 2010 10:07 amtesting
BBBllllaaahhh
August 8th, 2010 2:03 pmHoly shit, can somebody update this post saying this plugin does NOT work anymore? before anyone else, like me, wastes an hour trying to get it to work, only to find out the hard way…
Carl Thress
August 11th, 2010 7:57 amLooks like Twitter deprecated the email parameter in its API call, so the showUser($id) function no longer works. Too bad, really, because this looked like a pretty cool plugin.
Resim Paylas
September 20th, 2010 11:57 pmI like to post this comment .It helps a lot.The one thing I do know for sure, if that day comes, is that when it’s wedding cake cutting time, I will NOT make the same mistake I witness at every wedding. I will not be serving Champagne with dessert, but rather the slightly sweet and fizzy dessert wine,..
Thanks and Regards
M2
September 21st, 2010 12:36 amFine-sharing have been, thank you…
Ygor Teixeira
September 30th, 2010 6:04 amIm going make a test. :)
Ygor Teixeira
September 30th, 2010 6:05 amFailed
Gustavo Guichard
November 6th, 2010 5:24 pmIt’s not working :/… The Twitter API has been updated!
Tim
December 14th, 2010 2:19 amHey Ricardo,
Hope this works nicely with WP 3.x. Gravatars and Twitcons. Nice.
Rats….Jamie Bicknell and other report that changes at Twitter will make this not work nicely. What a shame.
Cheers,
Tim
Lee
May 21st, 2011 2:24 pmHi great plugin thanks!
Skywalk
August 1st, 2011 11:05 pmTesting
orlandotm
August 11th, 2011 2:00 amprova
jairo
September 5th, 2011 2:35 pm:D
teo
September 30th, 2011 5:16 pmTesting
turbo_MaCk
November 17th, 2011 4:29 pmDoes this works with WAMP? I don’t know why but on my ‘local’ I have everyone ‘without twitter like ‘ – with default avatar:-(
P.S. php_curl works
P.S. Twitter api change!!!!!!!!!!!!!!
dave
January 30th, 2012 4:05 ami don’t get it:
comments are displayed with the wordpress command
how am i meant to ‘Find the lines where the template manages the comments, and add the following line where you want to show the user’s avatar’?
miqueltsm
May 16th, 2012 4:00 amWow! Just testing