Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to limit tweets in Twitter timeline widget?

I am using Twitter's timeline widget seen below and would like to limit the number of tweets to 5. It is 20 by default. The website this is being embedded into is for visually impaired people who use screen readers. Screen readers get trapped inside the widget and the user is forced to tab through all 20 tweets to get out. There is no instruction for changing the number in twitter's documentation. I would be open to using other code. Thanks!

<a class="twitter-timeline" data-dnt="true" href="https://twitter.com/myprofile" data-widget-id="3007449998460120999">Tweets by @myprofile</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
like image 690
amy Avatar asked Feb 21 '13 06:02

amy


People also ask

How do I limit my Twitter timeline?

Tap the icon at the top of any Tweet, right from your Home timeline, to quickly access options like unfollow, mute, block, report, and more. Unfollowing is the simplest action you can take to stop seeing someone's Tweets on your Home timeline. You can always follow an account again if you change your mind.

How do I limit Tweets on Twitter?

Type your tweet. Underneath your text, you'll see a globe icon next to the words "Everyone can reply." Tap that icon, or the text, to open the limit options.

How do I customize my Twitter widget in WordPress?

To do that, navigate to the Appearance » Widgets menu from your dashboard. From this page, you can start managing your WordPress widgets easily. Now, click on the Sidebar panel to embed your Twitter widget there. You can also click on the Footer panel instead if you prefer to show Twitter content on your footer area.


2 Answers

You can set data attributes to the <a> tag to customize the timeline. Look at the Embedded Timeline documentation for more options.

You'll want data-tweet-limit=5.

like image 136
Steven Lambert Avatar answered Oct 11 '22 12:10

Steven Lambert


Hi you can set attribute in your link as data-tweet-limit="3"

for example.

<a class="twitter-timeline" data-lang="en" data-dnt="true" data-tweet-limit="3" href="https://twitter.com/AdliveTech">Tweets by AdliveTech</a> <script async src="//platform.twitter.com/widgets.js" charset="utf-8">

like image 22
Rohit Kaushik Avatar answered Oct 11 '22 10:10

Rohit Kaushik