When using the Timeline Express Twitter Feed Add-On you can easily convert our
[timeline-express] shortcode into a Twitter feed. You can use certain shortcode parameters to display different feeds. Feeds range from user feeds, so you can pull the latest tweets from certain accounts (or a combination of accounts), you can display a feed for a certain search term (think hashtags eg: #WordPress), display a feed of tweets from a certain geolocation or combine any of the options above to create a custom feed.
Twitter Feeds Add-On Parameters
tweet-count– Set the number of tweets to display on the timeline. (Possible: 1-99 Default: 10)
tweet-order– Set the twitter timeline to display in ascending or desecnding chronlogical order. (Possible: ASC/DESC Default: DESC)
twitter-user– Specify the account name to display tweets from (multiple accounts should be seperated by a comma).
twitter-term– Specify a term to search twitter for, and return related tweets. (Possible: Search term, hastags etc. Default: null)
twitter-geocode– Specify a latitude, longitude and distance from the location to pull tweets from. Example: Madison Square Garden: 40.7505045,-73.9934387, 1mi. The parameter accepts three items, Lattitude, Longitude and the distance from the location. See example below. Tip: Use google maps to retrieve lat/long for your location.
result-type– Display recent tweets for a term/user or only display the most popular tweets.(Possible: recent/popular Default: recent)
trim– During live reloading, old tweets are removed and the new, most recent, tweets replace them on the timeline. New items can be appended to the timeline, or replace existing ones. (Possible: on/off Default: on)
live-reload– Toggle on/off the live reloading functionality for twitter timelines. (Possible: on/off Default: on)
interval– Adjust how often your timeline will check for new tweets for your given term or username, in seconds. Note: This should not be set too low, or you’ll start to hit rate limits by the Twitter API. (Possible: on/off Default: on)
Display a basic User Twitter Feed
To display a Twitter feed for a specific user, you can include the ‘twitter-user’ shortcode parameter. This parameter accepts a single account name or multiple account names. If you are going to display tweets from multiple accounts you’ll want to separate the account names with a comma (Example:
Additionally, you can specify how many tweets to display in your feed, by including the ‘tweet-count’ parameter and including the number of tweets to display. (Example:
Putting it all together, displaying 20 tweets from the CodeParrots twitter account would look like:
[timeline-express twitter-feed="1" twitter-user="CodeParrots" tweet-count="20"]
Display Multiple Users Twitter Feed
To display multiple accounts in a single timeline, you can use the same shortcode parameters outlined above, but you can additional usernames to the ‘twitter-user’ parameter, separated by a comma. To display a twitter feed from two users, Code Parrots and WP Tavern, the shortcode would look like:
[timeline-express twitter-feed="1" twitter-user="CodeParrots, WPTavern" tweet-count="10"]
Note: Keep in mind, if you have two users and your tweet count is set to 10 – the plugin will pull the latest 10 tweets from each user (So a total of 20 tweets will display on the timeline).
Display Tweets For Search Term
The Timeline Express Twitter Feeds Add-On allows you to specify a term to search twitter for. You can specify your search term by using the ‘twitter-term’ parameter in the shortcode. This is mostly used to search twitter for a given hastag, say for an event, but can be used to search account name mentions (@username) or anything else.
To display the most recent tweets for the hashtag #WordPress, the shortcode would look like:
[timeline-express twitter-feed="1" twitter-term="#WordPress"]
Display Tweets For Specific Location (Geocode)
One of the more powerful features of the Twitter Feeds Add-On for Timeline Express is the ability to specify the geographic location where you’d like to display tweets from. This is great for events, for example, a conference, where you want to display tweets from a specific location. This can be combined with the search term parameter above, so you can display tweets from a specific location and only using a certain term.
In the following example, let’s say that a WordCamp is going on in NYC and we want to display the tweets from the venue, for users using the hashtag #WCNY16.
First, we’ll want to get the longitude and latitude of the event venue, which can easily be retrieved from Google Maps. You can search for your location, and when found retrieve the longitude and latitude from the URL.
Example for Madison Square Garden:
As you can see, from the highlighted URL the first part is the longitude and the second is the latitude.
Now that we have the longitude and latitude, we can decide how far away from the venue we would like to display tweets from. In our example, we only want to display tweets from within the venue, so we’ll use 1 mile.
Important: The distance parameter should be an integer value (1-99) followed by mi (for miles), with no space.
Finally, remember we want only want to display tweets with the hashtag #WCUS16, so we’ll use the ‘tweet-term’ parameter to specify our term, or hashtag.
[timeline-express twitter-feed="1" tweet-geocode="40.7505045, -73.9934387, 1mi" tweet-term="#WCUS16"]
Live Reloading Twitter Feed
Users can have a live reloading twitter feed, which re-queries Twitter for new tweets, for whatever parameters you have specified. By default, the live reloading twitter feed will replace all items on the timeline with the new results.
You can specify the interval that the Twitter feed should refresh itself using the ‘interval’ parameter. By default, the Twitter feed will refresh every 30 seconds. (Example: interval=”60″, would refresh the Twitter feed every minute (60 seconds)).
Live Reloading Shortcode Example:
[timeline-express twitter-feed="1" live-reload="on" interval="60" twitter-user="CodeParrots"]
Twitter Feed Example
For a few examples of the Timeline Express Twitter feed take a look at our Timeline Express Twitter Feeds Add-On Example page.