The Twitter Feed WordPress Plugin lets you simply output any user’s Tweets into your WordPress blog!
On 5th March 2013, Twitter deprecated v1 of their API, changing the way this plugin works. There are now 2 versions of this plugin. The free version outputs Twitter’s official (and very limited) embeddable timeline and can be found here.
Twitter Feed PRO uses API v1.1 to output tweets in the way the plugin used to work -with complete versatility and is still fully customisable.
Installation:
- Download the plugin direct from the Plugin Page at WordPress.
- Upload the whole plugin folder to your /wp-content/plugins/ folder.
- Go to the Plugins page and activate the plugin
- Insert the shortcode!
The Shortcode:
To insert the Twitter feed, simply enter the following shortcode within a page, post or text widget:
[twitter-feed]
Output @3doordigital’s latest feed:
[twitter-feed username="3doordigital"]
Output every mention of @3doordigital:
[twitter-feed username="3doordigital" mode="mentions"]
Output every retweet from @3doordigital:
[twitter-feed username="3doordigital" mode="retweets"]
Output a full public feed of my username – this includes my own feed, mentions of me and my tweets retweeted by others:
[twitter-feed username="alexmoss" mode="public"]
Search for “WordPress Plugin”:
[twitter-feed mode="search" term="WordPress Plugin"]
Output the hastag #Manchester:
[twitter-feed mode="hashtag" hashtag="Manchester"]
Implement Directly into your Theme
To enter the shortcode directly into templates using PHP, enter
echo do_shortcode('[twitter-feed]');
Settings:
You have to insert these values to make sure the feed is set up for you:
| Option | Default | Values | Comments |
|---|---|---|---|
| username | alexmoss | N/A | This is your twitter user username. The default is set to me |
| mode | feed | feed mentions retweets public fav search hashtag |
feed – outputs the most recent tweets mentions – outputs everyone’s tweets mentioning @username retweets – outputs retweets by others mentioning @username public – outputs latest tweets plus replies/mentions and retweets (basically a merge of feed and mentions mode) fav – outputs the favourites of @username search – outputs feed of that search term hashtag – outputs feed of that hashtag |
| other | no | yes/no | some people have found that their recent tweets haven’t been showing. using the option other=”yes” renders an alternative source for the tweets. NB – this will disable your profile image from appearing. |
| term | N/A | twitter alexmoss %23hashtag |
If mode is set to search, this is the search term the feed will output N.B. you will need to use HTML hex codes such as %23 for #. For a full list of HTML characters please click here. |
| hashtag | N/A | WordPress | If mode is set to hashtag, this is the hashtag term the feed will output. N.B. Enter the option WITHOUT the hash |
| num | 5 | 1-15 | The number of tweets to display. |
| twitterJS | no | yes/no | enables twitter’s JS for web intent. I have disabled this as default, and would suggest implementing this directly into your theme. However, the option is there! |
| userintent | yes | yes/no | adds user web intent to author links and avatars. NB twitterJS=”yes” may have to be added to make this work | tweetintent | yes | yes/no | adds web intent to all tweets, which includes retweet, reply and favorite icons. NB twitterJS=”yes” may have to be added to make this work |
| encoding | no | yes/no | Switch to yes if your feed outputs odd characters. This may apply if your tweets are in a language other than English. |
| decode | no | yes/no | Switch to yes if your feed outputs HTML characters for quote marks (single or doouble). |
Options:
There are a few attributes that you can use to change the way the twitter feed outputs within WordPress:
| Option | Default | Options/Examples | Comments |
|---|---|---|---|
| img | yes | yes/no | Displays the username’s avatar/profile image to the left of the tweet |
| auth | no | yes/no | Displays a link to @username at the beginning of that tweet |
| anchor | target URL | [LINK] click here |
The anchor text you want to use. As default, twitter’s t.co short URL will be output. |
| followlink | yes | yes/no | Inserts a link to your profile with anchor text “Follow @username on Twitter” |
| followbutton | yes | yes/no | displays a follow button underneath the twitter feed, and overwrites the followlink option if both are enabled. NB twitterJS=”yes” may have to be added to make this work |
| followercount | yes | yes/no | shows the number of followers by your @username for the follow button. |
| lang | en | en fr de it ja ko ru es tr |
the language you want the follow button to output. If nothing is entered, English will be output. fr – French de – German it – Italian ja – Japanese ko – Korean ru – Russian es – Spanish tr – Turkish |
| searchlink | yes | yes/no | Inserts a link to your search (if search mode is used) |
| userlinks | yes | yes/no | Inserts a link to any @username who is mentioned in a tweet N.B. this cannot be set to no whilst in search mode |
| hashlinks | yes | yes/no | Inserts a link to any #hashtag that is mentioned in a tweet. N.B. this cannot be set to no whilst in search mode |
| linktotweet | yes | yes/no | If timeline is set to yes, the timeline will link to the specific tweet within twitter.com |
| linklove | no | yes/no | Inserts a link to this page |
Timeline:
The tweet timeline can be displayed in various ways:
| Option | Default | Options/Examples | Comments |
|---|---|---|---|
| timeline | yes | yes/no | Whether you want the tweet to append xx minutes/hours/days ago from the tweet |
| conditional | yes | yes/no | Have a choice of xx minutes/hours/days ago or 01 January 2010 |
| phptime | j F Y \a\t h:ia | j f y | The PHP date format to output. More formats can be found here |
| tprefix | (about | the wording before the numeric timeline. | |
| tsecs | seconds | Inserts the word seconds. | |
| tmin | minute | Inserts the word minute. | |
| tmins | minutes | Inserts the word minutes. | |
| thour | hour | Inserts the word hour. | |
| thours | hours | Inserts the word hours. | |
| tday | day | Inserts the word day. | |
| tdays | days | Inserts the word days. | |
| tsuffix | ago) | the wording after the numeric timeline. |
Customisation & Styling:
There are a few attributes that you can use to customise the look and feel of the tweets:
| Option | Default | Options/Examples | Comments |
|---|---|---|---|
| divid | N/A | twitter-updates | The CSS class you want to give to the <ul> the tweets are listed within |
| liclass | N/A | tweet | The CSS class you want to give to each <li> each tweet is listed within |
| divid | N/A | twitter-feed | If a value is entered, the whole plugin will be surrounded by a DIV with the ID you choose |
