Just another bunch of stuff pouring out of some guy's head

WordPress Twitter widget

I’ve been wanting to dip my foot into WordPress widgets for while so when I noticed Twitter didn’t have a WordPress widget I decided to write one. Of course, I’m not the first.

The widget makes use of Twitter’s Javascript ‘badge’. It’s not sophisticated and there’s only 3 configuration options: Twitter account name, widget title and number of updates you want shown.

It saves you having to paste the code into your page and gives you a nice interface for changing the display options.

Installation

  1. Download the WordPress Twitter widget from WordPress.org.
  2. Unzip the downloaded file and upload/copy ‘twitter-widget.php‘ to your ‘/wp-content/plugins/widgets/‘ folder.
  3. Activate the ‘Twitter‘ plugin in your WordPress’ Plugins admin.
  4. Drag the ‘Twitter‘ widget to the sidebar in your WordPress’ Widgets admin.
  5. Configure the widget with your Twitter account name, widget title and number of updates you want shown.
  6. Save Changes and you’re done!

Thanks go to Mike Jolley for his handy widget tutorial.

Update – 2007-12-19

The widget is now hosted on WordPress.org. Thanks guys.

Also gotta send some love to the guys (and girls) that write Subversion, Aptana and Subclipse.

Comments

[…] WordPress Twitter Widget Using the Javascript, adds a sidebar widget to display Twitter updates. It’s not sophisticated and there’s only 3 configuration options: Twitter account name, widget title and number of updates you want shown. […]

Hey Sean, Just grabbed WP Twitter Widget and … so far, so good. One small problem: URL’s that are wider than the box don’t wrap around. I’m looking into how this might be fixed in code and will let you know.
In meantime, check out my blog: http://www.dalecoweb.com/thetroubleshooter.
Cheers, Dale

Hehe, you’re not the first to anguish over URL wrapping. I prefer to use bit.ly.

This link has an interesting answer to the issue.

I activated the widget, but only Sean’s tweets are showing just like above. How do I change this. I know nothing about HTML
Alex

[…] Twitter Widget : Adds a sidebar widget to display updates (using the Javascript Twitter ‘badge’) […]

Alex, you have to enter your Twitter username into the widget’s settings.

[…] 9.Twitter Widget […]

Hi there,
Nice widget, however I’d like a little bit of space between each tweet posted. Is there a way in either the settings, or exactly what file and what code/where do I need to make the change? I noticed a nice break between the tweets on this page.

There is no styling present in the widget. It takes all the styling from the CSS already present in your WP install. Please see my replies to other comments for help with this.

This is a great widget, however as Twitter is getting more and more popular I’ve noticed that there is a big lag on page load when the widget attempts to contact Twitter. It would be great to see an option to enable a cache, so that the last Tweet could be from a cache rather than a call to the Twitter server.

Once again, thanks for the widget.

Thanks Adam. Certainly Twitter’s performance varies but there are many other WP Twitter plugins and some that do caching. You should investigate those.

I have add twitter plugin in wordpress but i active the plugin there is an error

[…] you’re not too sweary or you’re like me and weary but don’t care, you can put a twitter gadget on your page. Not entirely sure how useful it is to display your own twits (like I’m doing) but maybe […]

[…] Software, Alex Rabe! Um meine letzten Tweets in der Seitenleiste anzuzeigen, habe ich das Plugin “Twitter Widget” von Sean Spalding installiert. Danke […]

Thanks for a quick and hassle free widget! Love it.

Thanks for the Widget! Was super easy to install and works great…

Thanks for the comments guys. Glad the widget serves your needs.

The widget code is very simple. If you’re getting an error it’s probably conflicting JavaScript from something else in your site.

[…] Twitter Widget ????????Widget?????Tweet??? […]

[…] Twitter Widget zeigt meine letzten Tweets in der Sidebar an […]

My Twitter feed only shows up if I am logged into WordPress. Otherwise it says “No public Twitter messages” Any advice?

Thanks.

Thank you plugin work really fine.

Ich habe das plugin installiert, habe aber Probleme mit den Umlauten, die es ja in der deutschen Sprache gibt. Kann man da was ändern?

Great widget, works great, but I have one issue. What is controlling the color of the text of the actual Twitter post that shows up on the sidebar in your widget. The Widget Title and the time stamp on the twitter post show up fine using the website colors, but the twitter post text does not. It’s a problem becuase it is black (or very dark) and I have it over a dark background. Any way to change the text colors of the Twitter post that is taken from Twitter?

Never mind. Figured it out based on an earlier post. in the CSS, added,
#twitter_div {color:#ffffff;}
Thanks.

Well done.

Hi there,

I successfully use your twitter widget on a blog of my own. However I recently started a new web site which host two domain name with different language content under the same wordpress instance.

If I use your widget, because the widget settings are shared between the domain, I will be able to show only one timeline.

What I want, instead, is displaying a twitter account for the english language and one for the second language.

The only chance I have is to manually plug the widget coding the widget into the sidebar, or eventually add a php variable which will influence the feed retrieving process.

Is this possible? Can you provide me some hints?

Many thanks
Andrea

I’ve been using your twitter widget for a while and thought it was working great until I recently began retweeting often. Retweets don’t seem to show up on the widget, yet they take up a blank space. Is there a fix for this so it will either display retweets or skip them entirely?

Thanks,
Aaron

Aaron, my best guess would be that the CSS of your site is styling the text of the retweets the same colour as the background of the page. Try a “control a” (select all) on that page and see if the retweets appear when reversed out.

I’m following a bunch of different news sources in Twitter. Is there a way to use this plugin on my blog to display the news feed from these sources? I’m not posting any updates myself yet.

@Brian: No. It only shows your tweets.

the widget seems to not work since i upgraded – any idea if there is a fix?

@joey, I can confirm that it works on 3.0.1. What version of WP are your running?

[…] WordPress Twitter Widget […]

Is it possible to have the plugin function on certain pages, and not on others?

@steve, it might be but this would be a function of WordPress, ie. different layouts for different pages. I have no idea if WP can even do that.

[…] Twitter for WordPress – Twitter is something I fell in love with in the past, and have now found a more stable plugin for WordPress. I use Twitter quite often, which is why I have it at the top. […]

Hey. This looks great. Can you help me figure out why the words get cut off on my site? Thanks.

Hi guys,

Great widget. But I am throwing IP away. After the tweets fall off, they are gone? Is there a way to ensure they all go into categories to be enjoyed forever and ever? Thanks. Bill

@Chip, not sure what you’re referring to. Example?

@bill. The widget doesn’t “keep” anything so it’s not possible for it to “throw away” anything. It’s merely a view of Twitter, provided by Twitter.

I would like to add the twitter logo which when clicked goes to my profile, how can I do this mate?

By the way this is a kick-ass widget, just what I was looking for!

@Chris, Thanks, glad it works for you. The code of the widget is generated by Twitter’s javascript so inserting an element into it is tricky. You could probably add the Twitter logo with CSS but not the link.

Hi,

I’m wondering if you know how to implement hover cards for this code. I have hovercards for my site entries and it looks a bit inconsistent if I don’t have them in the twitter box.

Thanks,

EB

@Elizabeth, sorry, I don’t. The closest I’ve gotten to Javascript development is copy-and-pasting “history.go(-1)“.

[…] en elTwitter Widget para WordPress de Sean Spalding, he modificado ligeramente el código para que muestre únicamente […]

[…] Twitter: Widget Twitter […]

[…] 2. WordPress Twitter Widget […]

Hi, thanx for your plugin,
I have more than 1 sidebar, and I wold to put the twitter widget in all, but I have just 1 to put..do you know how can I do?

Leave a comment

Line and paragraph breaks automatic, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required, never displayed)


Before you please complete the CAPTCHA below.

Time limit is exhausted. Please reload the CAPTCHA.

Sorry about the CAPTCHA but the SPAM was killing the site. I get thousands a day.