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.

176 thoughts on “WordPress Twitter widget

  1. The widget should work fine with WP2.8. It’s sounds like you’re seeing a high load on the Twitter site. This can make your tweets appear slowly or not all as the tweets are pulled directly from Twitter’s servers.

  2. Works great, thank you, Sean! One request (possibly already voiced by others): can we add a “Follow me” link right after or instead of “4 minutes ago”? That would be awesome.

  3. Your wordpress plugin page says it’s possible to use two instances of this widget? How? Once used, the widget is unavailable for a second account.

  4. Great widget! Still working under WP 2.8.2 but I can’t figure out how to modify the CSS to have my own background. Which section do I do that in?

    I’m below a CSS novice so any help you could give me would be appreciated!

  5. The widget is in a div id=”twitter_div”. Apply your CSS to this object.

    eg. #twitter_div {background-color:yellow;}

  6. Thanks! That did the trick for me. Now I just have to adjust the text position and my graphic.

    I appreciate the quick response!

  7. […] WordPress Twitter Widget: Useing the Javascript, adds a sidebar widget to cisplay Twitter updates. It’s not sophisticated […];

  8. Hallo und schönes fest erst einmal 🙂

    Habe mal einen Link zu deiner Seite gesetzt da du dich ja mit Twitter beschäftigst Oki…

    Bis dann lars

  9. Thanks for an easy to use widget. This is the third Twitter I have tried and it actually works and displays with my theme fine. Just upgrated to WP 2.9.1 and it looks great.

  10. Color me stupid, but I cannot get this to show up in my widgets. I am running 2.9.1 with News Magazine Theme 640 1.6.8 by antisocialmediallc.com and just getting it configured. I had to create a [widgets] folder where indicated as there was not one. It did not show up in the widgets section, so I uploaded to [plugins] and activated, but still cannot see it. Any thoughts to help out a moron?

    Thanks

  11. Jeff, look in the source code of any page the widget is supposed to appear on for the string “twitter_div”. This means the widget is installed OK. The display of tweets relies on Javascript and if the tweets aren’t appearing it’s *probably* because there’s some other (poorly written) Javascript on your page that’s conflicting.

  12. Hello Sean, The widget is perfect. But may i know how can i move the timestamp to a new line everytime ? where can i do that in php ? please help me.

  13. Hi Sean,

    I’m using your widget on http://www.sapnamagazine.com. It’s great! Two questions:

    (1) how do I edit the code so that a profile pic thumbnail is shown at the top?

    (2) how can I delete that gray bar from the top? that’s my widget header background, but I don’t want this widget to have a title (since I added another text widget on top as my title).

    Thanks in advance!! loving the widget.
    Mar

  14. Short answer: you can’t. The javascript that builds the feed is hosted on twitter.com. You can’t edit it.

    Long answer: maybe. This is the javascript that builds the feed. You could copy it, edit it to taste and host it on your own site, copyright/legal issues permitting.

  15. 1. The article already has a link to a widget editing tutorial.

    2. Any visual styling the widget has is taken from your blog’s theme. You’ll have to edit that. Note, there are already replies in these comments about editing CSS.

  16. Great widget! I have on 2.9.1 and it’s working perfectly. One question though.

    Is there a way to edit this widget so it will cache the tweets and only update the list at a set interval (half hour, hour, day, etc)? I have this on my site, but since Twitter’s connection is spotty, it can cause ungodly load times. And if Twitter is down, my page breaks completely. Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.