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

  2. 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.

  3. 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.

  4. 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.

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

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

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

    Thanks.

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

  9. 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?

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

  11. 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

  12. 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

  13. 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.

  14. 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.

  15. Pingback: Blogmonies
  16. @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.

  17. 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

  18. @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.

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

  20. @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.

  21. 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

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

  23. 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 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.