WordPress latest twitter sidebar widget
Last updated 2011 August 1
I made a WordPress widget to display latest Twitter updates for any Twitter user in a WordPress website’s sidebar. A widget is activated just like a plugin on any “widget ready” theme and can be positioned within the sidebar using the drag and drop Widgets page in the Administration Dashboard.
- Links @usernames, #hashtags and URLs
- Displays up to 20 twitter updates
- Works for any username with public tweets
- Does not require twitter password
- CSS friendly element IDs
Requirements to run
- WordPress version 3.0.0 minimum (MySQL 5 + PHP5)
- curl extension for PHP (details)
- json extension for PHP (details)
Installation Instructions
- Download latest-twitter-sidebar-widget.zip
- Decompress the file contents
- Upload the latest-twitter-sidebar-widget folder to a WordPress plugins directory
- Activate the plugin from the Administration Dashboard
- Open the Widgets page (wp-admin/widgets.php) under the Appearance section
- Drag the Latest Twitter widget to the active sidebar, edit and Save changes.
CSS Samples
This plugin includes its own stylesheet css file.
- Change text color to white
#latest-twitter-widget{ color: #FFFFFF; }- Make all the text bigger
#latest-twitter-widget{ font-size: 150%; }- Change the color of the links to blue
#latest-twitter-widget a:link { color: #0048c5; } #latest-twitter-widget a:visited { color: #0048c5; } #latest-twitter-widget a:hover { color: #0572dd; } #latest-twitter-widget a:active { color: #0048c5; }
Visit this plugin’s page in the official WP Plugins Directory, where some neat download stats reveal thousands of people have downloaded my code.
There are a handful of “latest tweet” plugins and widgets available, and most of them require your web server to be running PHP5. This widget uses the DOM XML object in PHP4.
This project is based on some code written by Ryan Barr. I added some sauce and already have a nice idea of where the next version will progress.
UPDATE: 2010 February 10
This will be the last version of this plugin that runs uses PHP4′s DOMXML object. All future versions published to this plugin’s page on the WordPress Plugin Directory will be PHP5 only. Click here to download the last PHP4 compatible build from my server, version 0.100210 of this plugin.
UPDATE: 2010 November 15
I just rewrote the guts of this plugin to work with Twitter’s 2010 API changes. The plugin requires PHP curl and PHP json be installed on your server, which means PHP5 is now required.
Comments(146)

Ahhh..I’ve been looking for something like this. What if you wanted to display your last 2 tweets and not have the icon so large?
I suppose such a circumstance would mean you are waiting for updates :)
I have yet to submit this to the WP Codex, and I am already planning the creation of a readme file. Stay tuned for additional changes.
hi! thanks for the widget!
Can you help me – what code should I write to my footer.php to run your widget?
I am making my own theme, very complicated.Widget code in sidebar.php is disabled by me because I need to load widget code at very specific places. So, at the place where I need twitter posts to appear I am trying to call init_latest_twitter(), but all I get in result is the pisture of twitter and the “Latest on twitter” header :(
So, maybe I am calling the wrong func?
Vadim,
Thanks for your interest in my widget plugin. You have actually caught me mid-update. I have made some changes to this plugin this week, and I am waiting for wordpress.org to list the new version of this code, version 0.090305, to be posted on the WP Codex download page.
I emailed you a .zip file containing the latest code. Give it a shot and let me know if the results are the same. I am not familiar with footer-ready widgets, but I am willing to make more updates to my code if it helps you out.
The local copy of this plugin is always the latest version and can be downloaded through this link.
when I install it it shows this error :
Fatal error: Call to undefined function domxml_open_file() in /usr/home/mano-ftp/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 105
manofstyle,
This means DOM XML is not installed on the server you are using. Write a phpinfo script like this:
<?phpphpinfo( );
?>
What version of PHP does it say your server is running? Does it mention DOM XML? If not, you may need to install this component on the server so this PHP object can be used. http://us2.php.net/domxml
[...] Creates a sidebar widget that displays your latest Twitter update for any given user. Visit Twitter Sidebar Widget [...]
I also get…
Fatal error: Call to undefined function domxml_open_file() in /usr/home/mano-ftp/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 105
I’ve checked my php settings and I have domxml..
DOM/XML enabled
DOM/XML API Version 20031129
libxml Version 2.7.3
HTML Support enabled
XPath Support enabled
XPointer Support enabled
Schema Support enabled
RelaxNG Support enabled
Any other ideas for getting this to work?
Ok. This plugin needs an options form. I will try abandon DOMXML during this rewrite so the code runs on more servers. Stay tuned, there is no time like the present.
My server is running both PHP4 & 5 with 5 as default. I could force it to load the script under PHP4 but would prefer not to. Another option for users could be to use Alexandre Alapetite’s domxml-php4-to-php5.php wrapper http://alexandre.alapetite.net/doc-alex/domxml-php4-php5/index.en.html
Corey that link may be of help in your re-write.
Cheers
Hi – thanks for all you do. I’m a relatively new WordPress user and am having difficulty installing the twitter sidebar widget. It says, “No response from Twitter.” Can you help point me in right direction? I don’t use CSS/any upgrades that get into the underpinnings of the code – is this the problem? I’d be willing to upgrade. Thanks.
@Matt I should be able to write a PHP5 version this week. I’ll send you an email when it’s ready.
@Susan Thanks for checking out my widget. Are you using WordPress.com or WordPress.org?
hey,
awesome widget. is there a way to edit the css? there is too much negative space between tweets for my liking…
thanks again
Sure, look for the variables $beforeUpdate and $afterUpdate in the code. As of version 0.090401, each update is wrapped in a <p> tag. It is possible that your theme’s stylesheet is defining padding or margins on this element.
I have PHP4 running on my server and I’m getting this error code
`htmlspecialchars_decode() expects parameter 1 to be string, NULL given in /web/sites/pamulex/utahacres.com/land/wp-includes/compat.php on line 105`
I just uploaded this plugin and also get a reading of:
Fatal error: Call to undefined function domxml_open_file() in /usr/home/mano-ftp/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 105
Did you ever find a solution to this issue? I’m not very code savvy, so the simpler, the better. Thanks!
Billie:
That error is not occuring in my file. Try deleting the htmlspecialchars_decode function from my plugin.
Samantha:
That means your version of PHP doesn’t support the code my plugin uses. If you are not very technical, you probably have to wait for me to come out with a PHP5 version, or choose another plugin.
For those facing “Fatal Error” messages, we think your problems can be solved if you contact your host and ask them about the safe mode. Some “paranoic” hosts use to do that…
Cheers!
[...] Creates a sidebar widget that displays your latest Twitter update for any given user. Visit Twitter Sidebar Widget [...]
This looks very promissing, however, I just uploaded your widget to my WordPress blog and received the error message:
Fatal error: Call to undefined function domxml_open_file() in /home/content/f/i/d/fiducia/html/govdave/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 83
I use GoDaddy hosting running on Linux with PHP5 – Can you help?
Drew:
That means your version of PHP doesn’t support the code my plugin uses. If you are not very technical, you probably have to wait for me to come out with a PHP5 version, or choose another plugin.
Thanks for the wonderful plugin. I had the same error too as I am running on an Apache server with PHP 5.0 Looking forward to your new plugin.
Thanks.
[...] Download: Latest Twitter Sidebar Widget Plugin Homepage: Latest Twitter Sidebar Widget [...]
[...] Latest Twitter Sidebar Widget – The best thing about this twitter plugin is that it works both on PHP 4 and PHP [...]
Hi Corey, great plugin for Twitter Updates. How do I add the dates/time for the updates? I would like to display how often I make updates.
[...] Latest Twitter Sidebar Widget – The best thing about this twitter plugin is that it works both on PHP 4 and PHP [...]
Let me repost that last one – apparently your comment box interprets HTML! I thought it would have been converted to plain text.
–
Hi Corey,
We’re using your plugin on our site, and it’s working great. Thanks for writing it!
In attempting to fit it into our site’s theme, however, we discovered that it uses inline CSS and doesn’t follow WP template standards for the widget’s HTML structure and CSS classes. This prevented it from properly fitting into our theme consistent with our other widgets, and we had to write some pretty kludgey jQuery commands in an attempt to make it a little more consistent.
The alternative to jQuery would be for us to correct these items in your plugin’s code, but that would make future upgrades to your plugin a pain in the neck.
So I’m wondering if you could try to clean up the HTML a bit in a subsequent version of your plugin. So far I’ve identified a few specific problems that would be great to have addressed:
- The entire widget is contained in a <div> with inline styles, no ID, no CSS classes. Since widgets are always listed in a parent <ul>, the container tag should at the very least be an <li>, not a <div>. Also it should be identified by an appropriate ID (such as “twitter-widget-1″ – see how other widgets accomplish the numbering), two CSS classes (“widget-container” at the very least, and another one like “twitter-wiget”), and no inline styles unless you have a very good reason to do so. All CSS should be taken care of in a .css file within your plugin directory. This way a theme can override the styles if it needs to.
- The twitter icon that you include, which looks great, also has no ID or CSS classes to distinguish it from other <a> and <img> tags within my sidebar. So there’s no way I can reposition the icon using my own theme’s CSS, except by editing your plugin or doing some dirty client-side jQuery. All such elements should be clearly identifiable in the HTML, and should not use proprietary inline CSS.
- Same problem with the <div> that is output in the widget’s footer. It should be identified with an ID and/or class in case the theme developer wants to align or format the “follow … on twitter” link differently.
I hope this sounds reasonable to you – I understand you probably had to take some shortcuts just to get the whole thing rolled out quickly. Bravo for your contribution.
Paul
Paul: Thanks for the feedback. You are right about my rush to release–the download stats for this plugin clearly show a dip when Twitter updated their API and broke my code. I can definitely make the improvements you want. Stay tuned, and thanks again.
It works some days and others i get this message.
Warning: Invalid argument supplied for foreach() in /home/content/60/6408460/html/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 42
Warning: Invalid argument supplied for foreach() in /home/content/60/6408460/html/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 46
Warning: Invalid argument supplied for foreach() in /home/content/60/6408460/html/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 50
“
Ron:
Thanks for the bug report. Maybe this is caused by certain status update content. I’ll test some entity-less items to see if a lack of hashtags, urls or user mentions in the update are causing a null value that triggers this message. If you want to help, you could email me the .json file the plugin saves in the plugin folder on your web server.
Thanks
Hi, Corey!
First of all, thanks for your work!
Well, I have the same problem as Ron.
Warning: Invalid argument supplied for foreach() in /srv/disk1/539641/www/meet4fun.ru/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 143
But before you plugin I tried another one. It didnt work too. Guys on wp forum thought that the problem was with cache. The thing is that cache plugin killed my admin access =)
so i didnt know if it could help.
Any way hope this information will help you a little!
Looks like this warning occurs when there are no twitter updates to display.
Stable tag: 0.101126
that was in readme.txt
I’m getting this warning, then the following line…
Warning: Invalid argument supplied for foreach() in C:\Websites\cashman2\wp-content\plugins\latest-twitter-sidebar-widget\latest_twitter_widget.php on line 143
follow @hummingbirdpost on twitter
Sorry, I meant to say thanks for your work on this plug in. :-)
Victor & Igor:
Have you entered a valid twitter user name in the widget options? Does that twitter user have their tweets set to public? The warning for line 143 means there are no twitter updates to display. I can fix the error from appearing as output, but that doesn’t solve the issue of there being no twitter updates found for the user name you have entered.
Unfortunately I’ve tried using a different plug in and it works – same username.
Victor: I’m glad you found a plugin that works for you. Thanks for trying mine!
It doesnt work with @salzano too…
Actually i think that there is something wrong with my WP.
I published a new version today to address all above issues. Thank you everyone for your feedback and test data. Today is 2010 December 05, so today’s release is version 0.101205.
Hi,
I am using your twitter widget on my site and it works great, however, I would like to use a different twitter feed on each page, is it possible to populate the username variable based on what page you are on?
Thanks.
Franc:
That’s an interesting use for this plugin. I don’t think multiple user names is very easy to manage at this time since I didn’t consider that while designing the plugin. What is the context for your use of a different set of twitter updates for each page? Maybe I could write a different plugin to serve this need if I believe it would be popular.
oh cory, my twitter thing doesn’t work again.
How do I change the colour of the text? My page background is black and the text isn’t showing.
thanks!
Just installed this on my blog a few days ago and LOVE it, so far.
But I noticed that it hasn’t updated itself with the stuff I tweeted this morning (about 20-25 minutes ago). I refreshed the blog several times and even changed the number of tweets from 3 to 5, but nothing. Is this a problem with the widget? Or is it just Twitter being dumb?
Ashe:
I’m glad you enjoy the plugin. It stores your twitter updates locally so each hit your website doesn’t acesss the twitter API. Twitter would actually block access to your tweets after about 150 hits in the same hour. More info on twitter API rate limits here: http://dev.twitter.com/pages/rate-limiting
The latest version of the plugin will only renew the data with twitter once every three hours. Perhaps I could shorten this interval to 30 or 60 minutes to be a bit closer to real time.
Oh, that makes sense. I was just worried it had stopped working altogether. 3 hours isn’t that much of a wait, especially since my blog is low-medium traffic. Thanks for the quick reply! (:
Hi – thanks for generously sharing your work.
I installed the plugin fairly easily, and my understanding of WP and code is strictly amateur.
The twitter feed works OK, but font size shows up really tiny on my blog. Can you suggest how to increase size? Many thanks!
Griff:
Do you know CSS? There is a stylesheet file in the plugin folder called latest_twitter_widget.css that you could use to change all aspects of the widget’s appearance.
Hey! I love all the positive comments your plugin is getting, and we would love to use it on our buddypress installation. However, I am hving multiple problems wit it. For one thing, it pulls what appears to be random tweets (not at all related to our account), for another, it displays this error:
Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when safe_mode is enabled or an open_basedir is set in /customers/tabletracker.com/tabletracker.com/httpd.www/community/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 78
?
Can you help us please? Or shall we abandon all hope ;-)
Thanks, Tabletracker.com
ed:
The warning you are receiving means that the PHP configuration on your web server is causing my code to malfunction. I’ll explore the issue, and you are the only one reporting this problem at this time.
Thanks for the excellent widget–I’ve tested a bunch of Twitter plugins, and this is by far my favorite. Smooth installation and operation, and easy to customize. Great work.
One suggestion, in line with a commenter above: the refresh rate should be much quicker than once every three hours. Thirty or sixty minutes would be ideal–hope to see that in future updates.
Brendan:
Thanks for your kind words. I agree, and a faster refresh rate is coming soon.
Hi! Love the plugin. I just updated to 3.1, and I receive errors with this code:
// the data is good, save the file
if( $haveTwitterData && $saveNewFile ){
//save new file
$theFile = fopen( $fileName, “w” );
fwrite( $theFile, $jsonData );
fclose( $theFile );
Help?
Ri:
What is the error that you’re getting? Before pushing the update this morning, I updated to 3.1 as well, and I have no issues.
I followed up with Ri via email, and we determined his problem was related to the server configuration running WordPress 3.1 on PHP4 and not sufficiently granting the proper permissions to the scripts including my plugin.
The specific error was
Permission denied ... on line 147A few hundred people have upgraded to the update I pushed out this morning, and I have received no other reports of problems.
Thanks for the cool widget. This is what I’ve been looking for. Clean & simple.
BUT it doesn’t seem to support UTF-8. Is there any way I can fix it? Most of my tweets for the site are in Korean with some english links, and it somehow mixes up Korean and English also with some strange symbols.
kyong:
That’s an awesome request. I hadn’t considered character sets at all! Let me see what I can do.
Corey, just now I saw your response Re. my troubles with the plug in. FYI, my team solved the issue, and it runs smooth as butter now ;-)
I would lov it if you could check out our site, and give us your feedback. Also, on another question, do you know who we need to write to to try and get featured in Buddypress.org?I think we may be worthy. What do you think?
Best,
Ed
PS: I will be delighted to grant you access to the Alpha version of our site (or to other fellow WP fans/users) just request an invite on the homepage.
Thanks for this widget – it is really easy for a newby like me to use and I am grateful for your work.
I am wondering how to make it display my twitter icon instead of the ‘t’ icon, and am not seeing just what I need to change in the code. I found how to change to position of the icon in the css file, but not how to change the icon.
I’m also wondering how I could put a frame around the twitter feed on my page. Is this a change I should try to make in the css file, or should I approach it through editing my theme?
pat:
Thanks for using my plugin. I like your icon idea. I had not considered displaying the user’s icon instead of the twitter logo, and it is likely the case that I can include this feature in the next release.
You should use CSS to create a border. Here’s a simple example that should get you moving in the right direction:
#latest-twitter-widget{ border: 1px solid #c4c4c4; }
That worked fine and I now have the border I wanted — but it hasn’t picked up my latest tweets. I tried deactivating and reactivating it, thinking it might have lost the initial settings, but I cannot figure out how to re-enter them.
Any advice?
It started working again! Magic?
Thanks for your help.
pat:
The widget only reaches out to twitter to get your tweets once every 30 minutes. Twitter doesn’t want third party applications hitting their servers constantly, so saving a local copy of the tweets is the way this plugin is designed.
Pat, I just swapped out the twitter.png icon in the plugins directory for my own and it looks terrific :) Thanks Corey for this clean plugin.
Hey Corey, the plugin is working great except the hashtags aren’t getting formatted, they just point to my homepage? any idea on how to fix it?
Thanks for the Great Plugin!
Sort of got it working… in the manually added http://twitter.com/#!/search?q= to replace hashtag->url in the fix_twitter_update function…
no hashtag url’s were in my .json file?
Mark:
I’ll take a look. I’m busy and rushing out now…thanks for trying the plugin.
I just tried to activate the plugin and something’s not working correctly.
Please check out what’s happening and let me know a fix or if I messed up somehow! http://www.hamiltondoulagroup.com/?page_id=189
I am on the newest WP installation.
Leanne:
That’s JSON output. It’s the raw data I get from twitter and save to your web server.
Do you know how to set up a phpInfo file? I bet your web server’s PHP configuration doesn’t support the code of my plugin. If you can show me your server’s phpInfo I may be able to help.
I’ll send you an email so we can continue privately.
I just published an update to this plugin. Version 0.110330 fixes the issue discovered by Mark above. Another bug that Leanne helped me discover in an email conversation has also been addressed. Enjoy.
Hi, Corey.
I was wondering if you can help me with a minor tweak. I am using your fantastic plug-in on my wife’s site, and it works great.
I would like the ability to have her twitter page open up in a new window or tab. I tried the below (adding target=”_blank” at the end of the href statement, but when I tried to activate the plug-in after the change, I got a fatal error.
echo “follow @$username on twitter“;
There was an error about a unexpected…on line 232.
when i pulled the target= option out, everything was fine. can you please help me figure out how I can use your plug in and have a twitter page open in a new window?
it would be good for folks to stay on her website rather than have to use the back button…
Thanks a bunch.
Shawn
I am having a problem. this widget looks great, but after installed, all i see is this on my page:
help please.
Warning: fopen(C:\sites\Single54\expeditions\Webroot\studio\wp-content\plugins\latest-twitter-sidebar-widget/jamesco.json) [function.fopen]: failed to open stream: Permission denied in C:\sites\Single54\expeditions\Webroot\studio\wp-content\plugins\latest-twitter-sidebar-widget\latest_twitter_widget.php on line 123
Warning: curl_setopt(): supplied argument is not a valid File-Handle resource in C:\sites\Single54\expeditions\Webroot\studio\wp-content\plugins\latest-twitter-sidebar-widget\latest_twitter_widget.php on line 125
[{"text":"Comics come alive at #WonderCon (#photos) http:\/\/t.co\/rY1WB52","truncated":false,"entities":{"hashtags":[{"text":"WonderCon","indices":[21,31]},{“text”:”photos”,”indices”:[33,40]}],”user_mentions”:[],”urls”:[{"indices":[42,61],”expanded_url”:”http:\/\/news.cnet.com\/2300-11386_3-10007271.html?tag=topStories3″,”display_url”:”news.cnet.com\/2300-11386_3-1\u2026″,”url”:”http:\/\/t.co\/rY1WB52″}]},”place”:null,”in_reply_to_user_id”:null,”favorited”:false,”source”:”\u003Ca href=\”http:\/\/twitter.com\/tweetbutton\” rel=\”nofollow\”\u003ETweet Button\u003C\/a\u003E”,”in_reply_to_screen_name”:null,”created_at”:”Sat Apr 02 20:46:00 +0000 2011″,”in_reply_to_status_id_str”:nu
I have a similar issue to James…Warning: fopen(/home/rocsiont/public_html/wp-content/plugins/latest-twitter-sidebar-widget/rocsidiaz.json) [function.fopen]: failed to open stream: Permission denied in /home/rocsiont/public_html/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 123
Warning: curl_setopt(): supplied argument is not a valid File-Handle resource in /home/rocsiont/public_html/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 125
[{“text”:”If your getting into the car and he is just now cleaning off the front seat for you he was not prepared for you \”
james & doug:
It sounds like your web servers don’t support the way I am using the curl library. I can modify the code (or you can modify the server) to hide warnings if the widget is working correctly despite the messages.
james & doug:
I have looked at the code. This warning is triggered when your web server does not allow my plugin to open a file and write to the folder where the plugin is stored. I could attempt to suppress the warnings, but the plugin will be useless without a local file store.
Was the plugin working for you before?
Hi Corey,
I really like your plugin, and I just wanted to share a tweak I made- all of my sidebar widgets do have a title, so I added a bit of code to the main function:
// output the widget
echo “Twitter” ;
It would be nice to specify this widget title in future versions.
Sorry, I forgot to properly HTMLize the code:
// output the widget
echo “<li id=\”latest-twitter-widget\”&rt;<h2 class=\”widgettitle\”&rt;Twitter</h2>” ;
Mike:
That’s certainly not a bad idea :) Another user helped me find a bug yesterday, so a new version is already in development. I’ll see what I can do. Thanks for using my plugin.
I published a new version tonight that includes Mike’s request for an optional widget title and a fix for the problem described here https://twitter.com/#!/salzano/status/55041519865966592
Thanks for sharing this! I noticed a small bug; you don’t check for the return value of the function curl_to_file. So when this function fails there is no nice feedback. Happened to me when I forgot to install the php5-curl extension.
Wietse:
Thanks for the tip!
Hi Corey, my tweets are all displaying in black, rather than @replies and links in blue like it does in your example shown. Why is this? Can it be fixed?
Megan:
Your wordpress theme will control the output of the widget. The plugin does have a stylesheet that you can use to customize the appearance. Do you know CSS?
Is there any way we can scroll the tweets after a given number such as after 5 tweets?
Carol:
By “scroll the tweets” do you mean put them in a box with its own scrollbar so the widget isn’t too tall?
Hey,
I love your latest twitter plugin – however, sometimes it will not display anything or show the following message…
“Invalid argument on line 224″ home/myketech/public_html/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php
Can you suggest anything?
Thanks
-Mike
I know a little CSS…where can I find the code to edit?
Also, sometimes I have the same problem as Mike (above). My tweets don’t always show up or there is an error message.
I just found the file, can you tell me where in the code I should edit to have the font larger and the @’s and links displayed in blue? Thanks!
Megan:
Try adding this to the .css file in the plugin’s directory:
#latest-twitter-widget{ font-size: 150%; } #latest-twitter-widget a:link { color: #0048c5; } #latest-twitter-widget a:visited { color: #0048c5; } #latest-twitter-widget a:hover { color: #0572dd; } #latest-twitter-widget a:active { color: #0048c5; }Hi, Corey!
Thanks for this great widget!
I like it a lot, but there is a bug showing up every time a hashtag appears in a tweet.
If a hashtag appears, the last letters of the word before the “#” disappear and the last letters of word after it get doubled (see image http://i52.tinypic.com/jjw6tw.jpg ). The link (http://twitter.com/#!/search?q=...), however, is correct without the “double letters”. Any idea how to solve this problem?
great widget
How do I get it to NOT show my replies? only tweets… thanks
MikeC: Your problem is international characters. For some reason they aren’t saving properly in the file where I store the tweets.
Mike: That’s a cool idea. I think I can do it.
I just published a new version 0.110509 that handles international characters properly (all of UTF-8). Thanks for the tips, friends, and enjoy the fix.
Hey Corey,
I just updated to version 0.110509. Before doing so, the plugin was working wonderfully. Now, however, I’m seeing the following error message in my sidebar:
No data found on twitter.com. Try a refresh!
Any ideas?
Thanks,
Tom
Awesome. This means the twitter API returned an error. You could wait 30 minutes for it to request new data from twitter, or delete the username.json file from the plugin folder so it tries again.
Thanks, man! I appreciate it.
I’m having the same problem as Tom. The new update was working fine yesterday but not today.
What exactly do I delete?
Thanks!
Hi
Any way this could be updated so that you can have more than one instance of the plugin in a sidebar?
Great plugin!
Thx
Couple of questions. First, a bullet shows up before the “Follow Me” title. How do I remove that?
Second, I have The Journal theme of WordPress, how do I change the background color to match the Related Articles widget that is automatically installed on my site?
Thank you,
Great plugin overall
I like the clean lines of this widget very much. Also the italics and quotes. Tweets are easy to read. Thank you!
I’m having the same bullet issue as the commenter above–although the bullet shows up before my first tweet. I’d like to remove it. If I can’t get it out of there, I may switch to a different plugin, but I’d rather not!
Also, there’s a lot of empty space above this widget. I use a text widget to title all my widgets, and this particular one leaves a large gap in the sidebar. Can I delete that in the CSS?
Thank you!
Disclaimer: PHP newbie and this is my first WP site… :)
I’ve got the plugin installed and the widget activated, but I’m seeing the raw JSON spewed out on the page.
I (think) I made sure that both the curl and JSON php extensions were installed… then this morning I bit the bullet and did a full upgrade of PHP (from 5.?.? to 5.3.6). Same issue.
It’s obviously something I’m doing (or not doing), as I don’t see any of the other 100+ comments asking about this (which figures, doesn’t it? ).
As a PHP n00b (I’m a ColdFusion developer), I’m not sure what info I can provide that would make troubleshooting easier… but if anybody has any ideas, or can give me specific info to report back, I’d be quite grateful.
Thanks!
Quick update… it _might_ be my template, which has a good amount of jQuery in it… there may be a conflict. Going to try with the default template.
Easy to remove bullet:
go to latest_twitter_widget.css
find: #latest-twitter-widget
add: list-style:none;
worked for me, hope it works for you too. Great simple plugin!
Hello, thanks for the plugin! It would be great to:
- configure the “follow [username] on Twitter” text with template tags
- disable the plugin css to use our own css
- have the title in a h3 (or configure it)
Thanks!
Working great for me…although I just added a new tweet 15 minutes ago and it is still not showing up on the site.
Is it not setup to be a real time feed?
Kevin:
Nope. Twitter only allows 150 requests to their API an hour, so every hit to your website can’t get new twitter data.
Occasionally I am seeing this error:
Warning: Invalid argument supplied for foreach() in /home/kstrasser/webapps/wordpress/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 230
Corey,
Please fix this issue :) It’s got too much of headache for all actually. I see it all looks cool, but some times it wont read the file.. What if you create two files and keep a old one, If the new one fails to load, you can read old one and show?
Occasionally I am also seeing this error:
Warning: Invalid argument supplied for foreach() in ……………./wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php.
I’m testing a new version of the plugin to make sure it addresses these latest issues. An update will be released soon. As always, thanks for the feedback.
I just published version 0.110711 that fixes the problems described above.
thanks for a great plugin! there seems to be something about a long username, though. if i use “ImSoVainDotNet” the widget doesn’t display anything besides “follow @ImSoVainDotNet on twitter”. if i change to a smaller username, it shows tweets just fine. is there username length limit?
Corey, Is this the link to download the latest version of your plugin?
http://downloads.wordpress.org/plugin/latest-twitter-sidebar-widget.zip
But the version still shows version 0.110509 instead of 0.110711.. Please reply to my email ID, if possible. Thank you!
Hi Corey,
Thanks for the plug-in. I have an issue with the widget title. If i use an apostrophe in the title it automatically inserts a forward slash before the apostrophe (e.g. “Preston/’s tweets”).
Do you know how I can fix this?
Thanks!
Hi, I love this plugin, it’s just what I needed.
There’s several tweaks I’d love to do to it. I’d like to add a speech bubble and place the text above my avatar.
Is there a way to find people’s mods to this widget? My knowledge of css is very limited, I can play around with it but I’m afraid of messing up the widget.
Again thanks so much for the widget!
Dear Corey
I’m using your latest twitter plugin widget which works great but sometimes the plugin gives the following error in the widget area when the page is loaded.
Warning: fopen(/home/bpldrwtk/domains/dapubblog.com/public_html/echtkerkelijk/wp-content/plugins/latest-twitter-sidebar-widget/bisdomroermond.json) [function.fopen]: failed to open stream: Permission denied in /home/bpldrwtk/domains/dapubblog.com/public_html/echtkerkelijk/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 127
Warning: curl_setopt(): supplied argument is not a valid File-Handle resource in /home/bpldrwtk/domains/dapubblog.com/public_html/echtkerkelijk/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 129
Do you know how to fix this? My host supports Curl and Json I can’t seem to recreate the problem on a local server.
If necessary, please contact me via the provided email address.
Kind Regards
Bas
Bas:
That error means the file saved to your web server by the plugin containing your twitter updates was non-existent when the plugin tried to open it.
I’ll look into it!
Hi Corey,
When i put it in my sidebar i get the message “No data available for user (username).
I have tried with a number of usernames.
Any ideas
Dave
Dear Corey
The warnings were magically removed and this message came in the place.
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/bpldrwtk/domains/dapubblog.com/public_html/echtkerkelijk/wp-content/plugins/latest-twitter-sidebar-widget/latest_twitter_widget.php on line 169
No data available on twitter.com for user bisdomroermond
Kind Regards
Bas
Bas:
Find a file bisdomroermond.json in the plugin folder. Delete it and refresh the page.
Dave:
Does your server have the json and curl installed? Details in the post above.
Dear Corey
I deleted the json.tmp file in the website root folder and everything worked again.
But after I deleted the files you mentioned (.json file and .json.tmp file) in the plugins folder. The widget area gave the same result I posted in my first post.
I hope this piece of information helps in tracking and cleaning bugs.
Good luck, I really love your plugin!
Kind Regards
Bas
Dear Corey
I found a fix to the bug I mentioned in my first post. I just needed to change the unix permissions of the plugin folder of your plugin to 777, after it generated the json files again I could change it back to the more safe 755.
~Bas
Bas:
The json file is replaced with a new file a few times each hour. The error will likely return if you chmod back to 755.
Hi!I love the simplicity and look of the plugin. I just have two questions…
1) I used it in the sidebar of my posts to show the latest news shared from my news Twitter account. The widget shows what I want but it is moved a bit to the right in comparison to the other widgets below. Why? Is it centred by default? Can I change it to aligned to the left?
2) I want to use it in an other page as well of my blog, but I can not find the widget in the menu of widgets to place it where I want. Maybe it can be used only in one place? Or maybe should I reinstall it again? How can I use it in a different place of my blog as well without choosing only one place?
Thank you and congrats for your widget!
Hi!
Is there a way to use the plugin if you don’t use widgets? I have all my sidebar items in my footer.php, thus I always edit the html/php codes there. Is there a php code or something I can just paste into my footer.php to use the plugin?
Hope you can help!
Hi! I installed the widget but get this error:
“No data available on twitter.com for user (so and so)”
I saw a comment above where a similar thing happened to a user, and your reply to delete a file called json.tmp, but I can’t find anything like that…
Thanks!
Suzanna:
You either have a bad user name or no permission to write a file to the server. If you can’t find a .json file in the plugin folder, the plugin wasn’t able to create it.
Great plugin–just a few days ago, though, it stopped updating. Any ideas? I have deactivated and reactivated but those old tweets persist…
Love the plugin. Very simple to use. Small issue though: We’ve recently changed our WP directory (from /cms to / ) and now the Profile Picture is broken. It looks as though the plugin is pulling from the Site Address instead of the WordPress Address.
Any ideas on a fix?
Actually, I found the issue. Its on line 248 of latest_twitter_widget.php
Changing [code] $pluginURL = get_bloginfo('home')."/wp-content/plugins/latest-twitter-sidebar-widget/";[/code]
to
[code] $pluginURL = get_bloginfo('siteurl')."/wp-content/plugins/latest-twitter-sidebar-widget/";[/code]
Seems to fix it.
siteurl should be wpurl. sorry
I have uploaded the plugin to my WP site and it displays my twitter icon, but I don’t see any tweets. Am I doing something wrong?
Hi Corey, me again!
I have a bullet point beside my first tweet (which actually only showed up this week!) and the advice above (add: list-style:none; }) is actually already in the css code. Any idea how to remove the bullet?
Also having trouble changing the colour. I added the code above and updated the file but no change. Does the code have to be inserted into a specific part of the widget css stylesheet? I bunged it on at the end. Amateur hour.
Can you help?
Thanks so much!
Hi Corey – great Plugin – easily the best of several I tried.
Got a question – I’d love to have the ‘follow me’ link not at the bottom of the widget but right-aligned next t the Widget title (that screen real estate is begging for the link!) but wondered if you knew an easy way to do this (I’m no CSS expert by any stretch!)
Dave
Hi Corey;
I think your plugin is the most adaptable and handsome Twitter display currently out there. Unfortunately, like others, I’m getting intermittent No Data Available errors – but only intermittently. My .json file comes and goes as it rebuilds – perhaps a result of Twitter and my ISP throttling the pull queries.
I’d love to know from you if your plugin rebuilds entirely with every query or only pulls the tweets themselves, or if you know of a workaround for this problem. I’m quite confused why it’s coming and going so often.
Many thanks for your work and for any thoughts you can offer.
Darren
It’s hard for me to say exactly what happens since I never see the widget without data on this very website. The plugin saves a good back up and reverts if no data is available when it hits the twitter API. I think the problem has to do with the server the plugin is running on. I am using hostgator and have never witnessed this problem on any of my sites.
I get an error, can’t see what i’m doing wrong:
http://www.ccoc.nl/over-ons/
Anybody?
If you want the links posted on the twitter to open in a new window;
edit this file latest-twitter-sidebar-widget/latest_twitter_widget.php
find this:
$index[$url->indices[0]] = “<a>url.”\”>”.$url->url.”</a>”;
replace it with
$index[$url->indices[0]] = “<a>url.”\” target=\”new\”>”.$url->url.”</a>”;
Save the file.
links will now be opened in new window
Hi,
I agree with the people saying this is currently the best Twitter-embedding plugin for WordPress – it works like a charm. :)
I do, however, have on question: how do I customize the font and size of the widget title? I have figured it out for the text and links in the feed but I cannot make it work for the title.
Regards.
Oh, one more thing: how do I make links open in a new window instead of the one my website is open in?
Thanks.
Hi Corey,
I have the plug-in working in my sidebar, however it disappears from time to time saying, “No data available on twitter.com for user” when in fact there is.
Any help you could provide would be most appreciated!!
Thanks,
Karen
hi,
i’ve the same problem with “no data available on..”
I’ve php curl and Php5 enable, i’ve modify chmod on file.
i’ve create then delete a file with .json
But still no data…
any idea?
thank’s!
I noticed when I place the widget above another widget there isnt any spacing between the bottom of WordPress latest twitter sidebar widget and the widget beneath. How can I add spacing after the WordPress latest twitter sidebar widget?
Chad: Does your theme put each widget in your sidebar in a list element? I try to play nice with the WP recommendations in theme development, but not all theme authors are on board.
Corey I am not sure what you mean my list element. Have a look at http://getmoneymarketing.net/leslie/ to see what I am talking about. Thanks for your help.
Chad
Chad: My suspicion was correct. Your theme does not wrap widgets in list items like shown on this page. http://codex.wordpress.org/Widgets_API#Register_Single_Sidebar That means my plugin is awkwardly coded in your sidebar, and this is probably why it looks odd to you.