Latest Tweet


This plugin displays the latest non-reply tweet from a user’s twitter timeline. Tweets are fetched using the twitter API via PHP and cached by WordPress to reduce API calls. No javascript required.


  • Fetches latest tweet using twitter API
  • Caches twitter timeline using WordPress built-in cache
  • Adjustable update frequency
  • Customize output with template
  • Server-side processing, no JavaScript, no delays


  1. Upload `latest-tweet` to the `/wp-content/plugins/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Configure the plugin in the Settings > Latest Tweet menu screen
  4. Include get_latest_tweet() in your theme
  5. For best practice, you should verify the function exists in your theme code before calling it:
    if (function_exists('get_latest_tweet')) get_latest_tweet();


  • get_latest_tweet( $options, $output )
  • options (array) – override control panel settings
  • output (boolean) – echo output if true, return if false [default:true]
option type default description
screen_name string n/a Your twitter screen name (username).
tweets_to_check integer 10 The number of tweets to request from twitter. If you tend to have a lot of consecutive @replies in your stream, it is best to set this higher to avoid a reply showing on your site.
html_template string ** The code to print out for the tweet.


  • Latest Tweet has been tested on WordPress 3.0. Earlier versions may work, but are unsupported.
  • PHP 5 running on your server


Latest Tweet Plugin 1.1.0
Last updated: 2010-07-25

Version History

  • = 1.1.0 = July 25, 2010

    • Updates via wp_schedule_event instead of in the output function to eliminate hesitant page loads
    • Changed function call to get_latest_tweet
    • Added ability to fetch result and suppress output
    • Consolidated settings
    • Converted to class to reduce risk of function collision
  • = 1.0.1 = March 18, 2010

    • Better handling of errors when twitter fails to respond
  • = 1.0.0 = December 30, 2009

    • Initial release.

Share Your Thoughts

Hi, is and , which you swear not to share with anyone, is .
If you're interested, I also have you can read at (optional).
Below are for this post: