Recently one of our readers asked us how they can show selective tweets in a WordPress widget. Previously, we have shown you how to add official Twitter follow button, how to add twitter cards, and how you can display recent tweets in WordPress using Twitter widget. The same twitter widget also comes with powerful tools allowing you to create streams for your twitter lists, tags, and search. In this article we will show you different ways to show selective tweets in WordPress using Twitter widgets.
Showing Tweets from a User with Specific Hashtag or Keyword
Let’s assume that you want to add twitter widget to your WordPress site showing only your tweets with a certain keyword or hashtag. Go to Twitter Widgets site and click on the search tab. In the search query box enter
from:wpbeginner #WordPress. Replace wpbeginner with your own twitter handle, and #WordPress with your keyword or hashtag.
Save your widget and copy the widget code.
On your WordPress site, go to Appearance » Widgets. Drag and drop a text widget to your sidebar and paste widget code inside it, save your text widget and preview your website.
Using Twitter Search to Create Custom Streams
Twitter comes with powerful search engine of its own. However, since tweets are not like articles, twitter comes with a different set of parameters to perform advanced searches for tweets. In the above example we searched for tweets by a particular user with specific keyword or hashtag. You can also search replies, mentions, tweets with links and keywords, tweets from nearby, etc. See a list ofTwitter search parameters and what they do. Use these parameters in the search widget and you can create your own tweet mashups.
We hope this article helped you show selective tweets in WordPress widgets. For questions and feedback, please leave a comment below.