How to display tweets on a WordPress page

There are a lot of ways to display your tweets on your blog. Many are complicated and ugly. Sometimes, you hit Twitter’s API rate limit. Most require the client to perform additional work. I made a very simple WordPress plugin to handle this.

All you do is stick [get_latest_tweets username="me"] where you want the tweets to go. You can optionally supply a count=X parameter to display more or fewer tweets.

JSON is cached, preventing the Twitter server from being hit more than twice in one minute.

You get markup like this, which you can style as you please:

<ul class='tweets'>
<li>@<a class='atreply' href=''>jane</a> Please dance a jig. <span class='date'><a href=''>3 hours ago</a></span></li>
<li>Anyone used TotalFinder? <a href=''></a> Saw it on @<a class='atreply' href=''>bob</a>'s machine and am intrigued. <span class='date'><a href=''>6 hours ago</a></span></li>

Grab the plugin from GitHub or the WordPress plugin directory.

Join the Conversation


Leave a comment

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