WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Kebo Twitter Feed

Display your Twitter Feed beautifully in 60 seconds.

Styling the Widget

We use the the inbuilt methods to output the Widget and Title containers so that it should fit seamlessly into your website.

If you want to style the inside of the Widget below is the HTML structure:

<ul class="kebo-tweets">

    <li class="ktweet">

        <div class="kmeta">
            <a class="kaccount"></a>
            <a class="kdate"></a>
        </div>
        
        <p class="ktext">
            <a><img class="kavatar" /></a>
        </p>

        <div class="kfooter">
            <a class="ktogglemedia"></a>
            <a class="kreply"></a>
            <a class="kretweet"></a>
            <a class="kfavourite"></a>
        </div>

        <div class="kmedia">
            <a><img /></a>
        </div>

    </li>

</ul>

The slider has one significant change which is that the containing unordered list has an ID of 'kebo-tweet-slider'.

Developers Notes

You can directly access the object containing all the Tweets like this:

<?php $tweets = kebo_twitter_get_tweets(); ?>

This function checks the cache and refreshes the data if needed. Then returns the object containing all the Tweets. Below is an example of how you might use the data:

<?php $tweets = kebo_twitter_get_tweets(); ?>

<?php $i = 0; ?>

<?php if ( isset( $tweets->{0}->created_at ) ) : ?>

    <?php foreach ($tweets as $tweet) : ?>

        <?php echo $tweet->text; ?>

        <?php if (++$i == 10) break; ?>

    <?php endforeach; ?>

<?php else : ?>

    <p>Sorry, the Tweet data is not in the expected format.</p>

<?php endif; ?>

What data is available?

The object we store contains everything that the Twitter API returns, leaving what you use in your control. Below are some of the most useful items:

$tweet->id_str // Tweet ID
$tweet->created_at // Date/Time created
$tweet->text // The content text (URLs already HTML links)
$tweet->user->id_str // Author ID
$tweet->user->name // Author display name
$tweet->user->screen_name // Author screen name
$tweet->user->location // Author location
$tweet->user->description // Author description
$tweet->user->followers_count // Author followers count
$tweet->user->friends_count // Author friends count
$tweet->user->profile_image_url // Authors profile image URL
$tweet->user->profile_image_url_https // As above but with HTTPS

There are many ways you could use this information for more than just a Twitter Feed. For example you could also use this to track the follower count of your Twitter account for display on your website.

Shortcodes

Currently there is one Shortcode which can be used to replicate the behavior of the Widget. You can call this shortcode in the content of a post and/or page using:

[kebo_tweets]

Or by using PHP directly:

<?php echo do_shortcode('[kebo_tweets]'); ?>

Here is the shortcode with all the available attributes and their default values:

[kebo_tweets title="" count="5" style="list" theme="light" offset="false" avatar="off" conversations="false" media="false"]

The available options are:

title - Text
count - 1-50
style - list/slider
display - tweets/retweets/all
theme - light/dark
avatar - on/off
offset - 1-50
conversations - true/false
intent - true/false
media - true/false
media_visible - true/false

Embedded Tweets

WordPress has inbuilt functionality for embedding Tweets directly into posts/pages. You can do this by simply pasting the full URL of the Tweet into the content, the URL will look similar to this:

https://twitter.com/BarackObama/statuses/266031293945503744

Requires: 3.2 or higher
Compatible up to: 3.9.2
Last Updated: 2014-6-1
Downloads: 144,227

Ratings

4 stars
4.3 out of 5 stars

Support

2 of 5 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

100,2,2 100,2,2 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1
100,1,1 100,2,2 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1
100,3,3 100,1,1
100,1,1 50,2,1 100,1,1 100,1,1 100,1,1 100,1,1
50,2,1
100,1,1 100,1,1 100,2,2 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,1,1 100,1,1 100,2,2