How to Display Recent Tweets in WordPress Blog

Share This Article:

Ever thought of displaying recent tweets in your WordPress blog ? here is a simple solution for that. Twitter is the most popular micro-blogging platform with many power users and celebrities. Display recent tweets in your personal blog sidebar or showcase them in any of your WordPress blogs.

Follow us on twitter @WPSquare

display-recent-tweets-in-wordpress

Recent tweets can be displayed in blog sidebar by using any of these three methods.

  • Using RSS Fetching Snippet
  • Using Official Twitter Widget
  • Using WordPress Plugins

Display Recent Tweets in WordPress without a Plugin

If you don’t want to use plugin or if you feel plugins will slow down your blog, then here is a simple code that helps to display recent tweets in a fly. Learn How to Execute php in WordPress Text Widget and add the below code to text widget in sidebar.

<?php
include_once(ABSPATH . WPINC . '/feed.php');
$rss = fetch_feed('https://api.twitter.com/1/statuses/user_timeline.rss?screen_name=wpsquare');
$maxitems = $rss->get_item_quantity(3);
$rss_items = $rss->get_items(0, $maxitems);
?>

<ul>
<?php if ($maxitems == 0) echo '<li>No items.</li>';
else
foreach ( $rss_items as $item ) : ?>
<li><a href='<?php echo $item->get_permalink(); ?>'><?php echo $item->get_title(); ?></a></li>
<?php endforeach; ?>
</ul>

Replace the highlighted name in the code with your twitter username and save it. You can also use this code anywhere in your theme files. If you are using Thesis or Genesis you need to wrap this code in desired hook.

Display Recent Tweets Using Official Twitter Widget

Here come the official twitter widget with lots of options and preferences. Just navigate to the official twitter profile widget page using the link below and configure the widget.

Twitter Official Widget

Just enter your twitter username and your recent tweets will be displayed in the widget. using preferences select number of tweets to display and change colors by using  appearance tab. Finally get the code by setting up proper widget dimensions.

twitter-official-widget

Copy and paste the code to text widget in sidebar section. All your recent tweets will be displayed and to change the number of tweets to be displayed, you can directly edit in the code or can configure the widget from scratch.

Display Recent Tweets in WordPress Using Plugins

If you don’t want to mess up with code part, then here are some beautiful plugins to display recent tweets in sidebar. All the plugins are free to use and are available at official WordPress plugin repository. Checkout the info and install your favorite plugin.

display-recent-twitter-wordpress-plugins

1. Twitter for WordPress

Free plugin to display recent tweets in sidebar of your WordPress blog. Simple drag twitter widget to sidebar and configure it (no options panel).

Download Plugin »

2. Latest twitter sidebar widget

This plugin got many features and can handle twitter feed, links, hash tags etc. Profile picture can be displayed and replies to your tweets can also be included.

Download Plugin »

3. WP Tweets

Widget ready Light weight plugin with free online support. Options are available to configure twitter username and number of tweets to display.

Download Plugin »

4. Twitter Widget Pro

This is another great plugin to display recent tweets in WordPress sidebar.  Configure the widget by giving a feed title, entering a twitter username and date format etc.

Download Plugin »

5. Tweet Blender

Finally, tweet blender is just an awesome twitter widget to display tweets based on lists, hash tags etc even incase of multiple users and multiple lists.

Download Plugin »

Hope you like this ultimate article on how to display recent tweets in WordPress, to receive more articles like this just subscribe to our feeds by using the form below.

Genesis is the most flexible WordPress theme framework that comes with tons of options. We have been using Genesis on all of our blogs and recommending the same to you. Every bit of it is coded according to the standards. Give it a try!

Comments

  1. Ammar Ali says:

    Official recent tweet widget is much better than any plugin ;)

    • WPSquare says:

      Agree with you Ammar, nothing is better than official one :)

  2. The Colorful White says:

    Thanks for the code on how to add it, I will use this on my other blog.
    Thanks again!

  3. cletus says:

    thank for sharing for coding……………

Speak Your MindComments Policy →

*

Looking for More Awesomeness?

Read previous post:
add-feedburner-optin-form-wordpress
How to Add FeedBurner Optin form to WordPress Blog

How to Add FeedBurner Optin form to WordPress Blog. If you are looking to get more subscribers for your blog,...

Close