WPTWIT is a plugin for WordPress which integrates Twitter into your site. With a useful sidebar widget and a powerful templating system, this plugin allows you to keep your visitors updated with your latest tweets. You can see the plugin in action by looking at my sidebar. This work is licensed under a Creative Commons Attribution-Share Alike 3.0 License. Just download it already! Or, are you having trouble? I can help!
Join the 903 people who have downloaded WPTWIT.
Like this plugin?
Features
- Simple templating system.
- Automatic time offset detection.
- Included sidebar module/widget.
- Uses the integrated WordPress RSS parser.
Documentation
- Download the plugin.
- Unzip to your plugins directory.
- Activate the plugin.
- Go to Options — WPTWIT.
- Enter the URL of your Twitter RSS in the Feed URL field. You can use the URL by going to bottom of your Twitter page and right clicking
RSS Feed
. - Enter the number of statuses you would like to display in the Number of Statuses to Display field.
- Put anything you would like to appear before the list in the Before List field. (eg.
<ul>) - Put anything you would like to appear after the list in the After List field. (eg.
</ul>) - Enter the date format you would like to use in the Date Format field, according to the PHP format.
- Enter the template you would like to use in the Default Status Template field. Use the template tags in it. (eg.
<li class="current"><a href="%link%" rel="bookmark" title="%time_ago%, ago I was %status%"><span class="time">%date%</span><span class="status">I was <strong>%status%</strong>.</span></a></li>) - Enter the template you would like to use for your latest status in the Current Status Template. Use the template tags in it. (eg.
<li class="current"><a href="%link%" rel="bookmark" title="%time_ago%, ago I was %status%"><span class="time">%date%</span><span class="status">I am <strong>%status%</strong>.</span></a></li>) - Click Update Options ».
You should be able to add the Twitter Module
to any widget-enabled theme. It will automatically call the list, with a containing div class of sb-twitter. If your theme does not support widgets, you can call <?php ae_wptwit_output(); ?> to produce similar output.
Template Tags
%user%- Displays the username from twitter feed.
%status%- The status message with username stripped.
%update%- The twitter status message.
%parity%- Output the parity of the message. (Odd or even, starting from current message as odd)
%date%- The date of message; formatted according to date format above.
%time_ago%- How many hours/minutes ago the status was sent; if over 24 hours will say ‘over 24 hours’; if over 2 hours, will say ‘over x hours’; if less than 2 hours, will say how many hours/minutes ago
%link%- Outputs a link to the status on Twitter.
Changelog
1.0 beta
- Initial public release
1.1
- Added better time zone support
1.2
- Added support for PHP 4
- Improved time zone support
1.3
- Added a %parity% tag for styling.
Need a custom plugin or theme? Contact me to work something out.

What do I need to put in my sidebar if I don’t use widgets?
@hoboken411:
This should produce your list, with before and after templates included. I have updated the documentation accordingly.
Great Plugin!
@Luca: I’m glad you like it.
The timezone is off when it is integrated into my website at http://carsonweber.org (see sidebar under “WHAT I’M DOING”)
How much is the time off by? I am looking at the best way to set the time.
The timezone is off when it is integrated into my website at
The latest version relies upon the WordPress time zone setting to establish the correct time. If it doesn’t work for you, check that setting.
I get the following error message:
Fatal error: Call to undefined function: str_split() in /home/xxxx/xxxx/mindfulofmirrors/wordpress/wp-content/plugins/twitter.php on line 20
Any ideas why?!?!
@jl: It was an issue where your version of PHP (PHP 4) did not support the command used in my plugin. I have now updated the plugin with alternative code so that it should be PHP 4 compatible. Download the new version and if you have any further issues, don’t hesitate to bring them up. Thanks for brining this to my attention.
P.S. The alternative code may also improve time zone handling for some people. (Time zone handling is a hard thing for me to test for obvious reasons)
arthus: thanks for the reply. i downloaded the plugin from this link but it’s v1.0 beta.
http://myfla.ws/download/wptwit
where can i get the new version?
Sorry about that, I forgot to update the version of the zip. The new version should be online now… feel free to download.
thanks for that arthus… but the new version still doesn’t seem to be accesible from that link. I keep getting the older v1.0 beta… would you mind emailing the new version to me?!?
thanks heaps!
That is very strange… I tested the download and I am getting the new version. You might try clearing the cache and ensuring you are unzipping it correctly. I sent you the new version by email anyways.
arthus: thanks for the file - i got it!
but now i’ve got another problem! although I set the options to display the last 3 or 5 statuses, only the most recent appear - is something amiss?!?
I have no idea why that would be happening to you. If you have a link to your page with this on it, that would be helpful. The problem might be that you didn’t fill out both templates in the admin panel - be sure to do so. Even if you use the same styling for new and old statuses, you must have the template completed for both.
it’s very strange… i’ve filled out both templates on the admin/options panel. in fact, i’ve filled out all the fields in the options panel. you can see my blog here:
http://www.mindfulofmirrors.com/
it’s right at the bottom.
arthus: more strange updates!
the plugin will display the current status and ONE older status but despite setting the options to display 5 statuses, the plugin will output no more than the current status and ONE older status and i know i have more than 2 statuses on my twitter account.
any ideas what could be wrong…?!?
jl: I think I might have found your problem. My plugin does not play nicely with the widgets plugin unless you use my own widget. So, to fix it, just enable the twitter widget in your footer.
Hi, I am using your wonderful plugin now, it work so good but only one problem, it seems not support Chinese. When I post some Chinese words in twitter, this plugin always displayed “??????????”. Can you help me? thanks!
@niuhuifei: I have looked into this and there doesn’t seem to be any problem. As you can see from my sidebar, chinese characters display fine with this plugin. The plugin will print out exactly what is recieved from Twitter.
I have a suspension that your issue might be arising from a character set issue. If you look in the source of your page it will proboably display the chinese fine - it is just not working once the character set tries to process it.
You actually appear to be setting the character set twice, so removing one of the lines should fix it. (From header.php in your theme)
Many thanks for your reply. But it also not work well in my site when I post Chinese. I have removed the second character set from my head.php. My theme isnot wedgted, and I just use the . I don’t know why, my god!
I have no idea what your problem is. I would look into PHP settings or WordPress parsing settings. WPTWIT uses the built-in Magpie RSS to read your Twitter feed - that could be the source of the problem. No idea otherwise. Sorry!
Hi, a good news, I have fixed my problem, it is not due to your plugin, but my space. now it work well. thank your good plugin again!
Glad to hear everything is working for you.
When I put in the variable to include WPTWIT, I got this error message:
Warning: array_slice() [function.array-slice]: The first argument should be an array in /home/.jaffa/melindam/rinato.eorlingas.org/wordpress/wp-content/plugins/twitter.php on line 25
Warning: Invalid argument supplied for foreach() in /home/.jaffa/melindam/rinato.eorlingas.org/wordpress/wp-content/plugins/twitter.php on line 31
If you could help me with that it would be much appreciated!
From the looks of it, it appears your Twitter feed is blank.
Either you have not configured it correctly with your Twitter RSS feed or you need to get tweeting!
If you can tell me your twitter username, I can try to help you a bit more.
engulf: http://twitter.com/engulf
I tweeted three times to test things out for the plugin, but I got that error message instead. Thanks in advance!
Make sure that you have configured the options page correctly. These settings should work for you:
Feed URL: http://twitter.com/statuses/user_timeline/8893472.rss
Number of Statuses: 5
Before List: <ol>
After List: </ol>
Date Format: D H:i
Default Status Template: <li class=\"current\"><a href=\"%link%\" rel=\"bookmark\" title=\"%time_ago% ago I was %status%\"><span class=\"time\">%date%</span><span class=\"status\">I was <strong>%status%</strong>.</span></a></li>
Current Status Template: <li class=\"current\"><a href=\"%link%\" rel=\"bookmark\" title=\"%time_ago% ago I was %status%\"><span class=\"time\">%date%</span><span class=\"status\">I am <strong>%status%</strong>.</span></a></li>
If it still doesn’t work, please check back. The next version of my plugin will be far easier to configure.
This is most likely just an issue of caching. Give it some time and the problem will hopefully iron itself out.
Also, be sure that Default Status Template and the Current Status Template have something in them.
Thanks for the advice, but it still only shows one update. D: Thanks anyway though!
Great plugin! It works great for me, but now Im trying to format it to my liking.
Im wanting to have alternating backgrounds for each tweet. I can do the code, but is there a counter variable built in that I can call?
I was hoping to do something like:
if $i is even: use this bg color
if $i is odd: use this alternate bg color
I guess my question is… is there a built-in “$i” that I can use?
Thanks a ton!
Daryl
Thanks for the suggestion, Daryl.
I have pushed that feature into the 1.3 release. Now just call the %parity% variable in your template and it will return odd or even based upon the parity of the number. (I figure you can do the rest with CSS)
You don’t need to touch any of the plugin code to get this to work.
Great plugin! It’s very useful to me. Thanks!
Glad it’s helpful, Catzie!
I have looked into this and there doesn’t seem to be any problem. As you can see from my sidebar, chinese characters display fine with this plugin. The plugin will print out exactly what is recieved from Twitter.
I have a suspension that your issue might be arising from a character set issue. If you look in the source of your page it will proboably display the chinese fine - it is just not working once the character set tries to process it.
You actually appear to be setting the character set twice, so removing one of the lines should fix it. (From header.php in your theme)
Thanks for sharing that… I’m glad there are no issues with my plugin. I think he ended up getting the issue fixed on his space. Thanks for sharing anyways.
Great Plugin for Twitter - very useful. Keep up the good work!
@Patrick: Thanks!