How to Shorten Your Twitter Feed in a Blog Widget

After embedding your Twitter feed on your blog you will notice that may show upwards of 10 tweets or more, which takes up a lot of space in your sidebar. I recommend only showing 3-5 tweets in your feed. To shorten your Twitter feed, you can adjust the embed code by doing the following: 

1.  Go to the Text widget where you’ve pasted the embed code from Twitter. You will see something similar to this:

<a class=”twitter-timeline” href=”https://twitter.com/LeighCassell”>Tweets by LeighCassell</a> //platform.twitter.com/widgets.js

2.  The next step is to insert a line of code to change the number of tweets showing in your feed. Insert the following line of code after “twitter-timeline” (data-tweet-limit=”5″) so it now reads like this:

<a class=”twitter-timeline” data-tweet-limit=”5″ href=”https://twitter.com/LeighCassell”>Tweets by LeighCassell</a> //platform.twitter.com/widgets.js

You can change the number in quotation marks (data-tweet-limit=”5″) to any number you want based on the number of tweets you want showing at a given time. For example, if you only want 3 tweets showing, your new code will read like this:

<a class=”twitter-timeline” data-tweet-limit=”3″ href=”https://twitter.com/LeighCassell”>Tweets by LeighCassell</a> //platform.twitter.com/widgets.js

3.  Save your changes to the Text widget and you’re done!

These instructions have also been added to the Help and Support document, Adding Twitter to a Sidebar Widget

If you have any questions or need some extra help I’m just an email away…

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: