Obtaining a Twitter authentication key
- 01Go to https://dev.twitter.com/apps/new
- 02Login using your standard Twitter credentials
- 03Complete the form:
- 04Name: ThinkTwit – [site name]
- 05Description: ThinkTwit plugin
- 06Website: [url of your website]
- 07Callback URL: [url of your website]
- 08Make a note of your “Consumer key” and “Consumer secret”
Installing plugin
- 09Unpack the zip file and upload the thinktwit folder to the /wp-content/plugins/ directory, or download through the Plugins menu in WordPress
- 10Activate the plugin through the Plugins menu in WordPress
- 11Navigate to Settings->ThinkTwit from the WordPress Dashboard
- 12Enter the “Consumer key” and “Consumer secret” obtained earlier and save your settings
Updates are automatic. Click on Upgrade Automatically if prompted from the admin menu. If you ever have to manually upgrade, simply replace the files with those from the new version.
Configuring widget
- 13Go to Appearance and then Widgets and drag ThinkTwit to your sidebar
- 14Fill in the options as required and then save
Configuring shortcode
ThinkTwit can be used in any page or post, or anywhere else configured to use shortcodes, using the following syntax:
[thinktwit widget_id=0 usernames="stephenpickett" hashtags="thinktwit" hashtag_filter=0 username_suffix=" said: " limit=5 max_days=7 update_frequency=-1 show_username="username" show_avatar=1 show_published=1 show_follow=1 links_new_window=1 no_cache=0 live_update_freq=0 debug=0 time_this_happened="This happened " time_less_min="less than a minute ago" time_min="about a minute ago" time_more_mins=" minutes ago" time_1_hour="about an hour ago" time_2_hours="a couple of hours ago" time_precise_hours="about =x= hours ago" time_1_day="a day ago" time_2_days="almost 2 days ago" time_many_days=" days ago" time_no_recent="There have been no recent tweets" ]
Configuring Output Anywhere
ThinkTwit can be called within templates and other areas where you can use PHP using the following syntax:
<?php $args = array( 'widget_id' => 0, 'usernames' => "stephenpickett", 'hashtags' => "thinktwit", 'hashtag_filter' => 0, 'username_suffix' => " said: ", 'limit' => 5, 'max_days' => 7, 'update_frequency' => 0, 'show_username' => "name", 'show_avatar' => 1, 'show_published' => 1, 'show_follow' => 1, 'links_new_window' => 1, 'no_cache' => 0, 'live_update_freq' => 0, 'debug' => 0, 'time_this_happened' => "This happened ", 'time_less_min' => "less than a minute ago", 'time_min' => "about a minute ago", 'time_more_mins' => " minutes ago", 'time_1_hour' => "about an hour ago", 'time_2_hours' => "a couple of hours ago", 'time_precise_hours' => "about =x= hours ago", 'time_1_day' => "a day ago", 'time_2_days' => "almost 2 days ago", 'time_many_days' => " days ago", 'time_no_recent' => "There have been no recent tweets"); echo ThinkTwit::output_anywhere($args); ?>
Shortcode/Output Anywhere Parameters
widget_id : integer – You should give this a unique id for caching or styling.
usernames : string – The list of Twitter usernames to output tweets for.
hashtags : string – The list of hashtags to output tweets for.
hashtag_filter : string – 1 indicates that usernames AND hashtags must both exist in a tweet, 0 indicates that either can exist.
username_suffix : string – The text that should appear after a username e.g. ” said: “.
limit : int – The maximum number of tweets to display.
max_days : int – The maximum age in days of the tweets to be displayed.
update_frequency : int – Minus 1 indicates live (uncached), minus 2 indicates paused, 0 indicates live (cached), and anything else indicates the number of hours between getting updates from Twitter.
show_username : string – None indicates no username should be shown, name indicates the user’s full name should be shown and username indicates the user’s username should be shown.
show_avatar : boolean – Indicates whether the Twitter user’s avatar should be displayed – 1 for true and 0 for false.
show_published : boolean – Indicates whether the time the tweet was made should be displayed e.g. “This happened a day ago” – 1 for true and 0 for false.
show_follow : boolean – Indicates whether or not to show a “Follow @username” link for each username.
links_new_window : boolean – Indicates whether links should be opened in a new window – 1 for true and 0 for false.
no_cache : boolean – Indicates whether or not to use no-caching – 1 for true and 0 for false.
live_update_freq : int – The frequency of live updates (zero for off).
debug : boolean – Indicates whether to turn on debugging mode – 1 for true and 0 for false.
time_this_happened : string – Time prefix (default: “This happened”).
time_less_min : string – Time less than 1 minute (default: “less than a minute ago”).
time_min : string – Time approximately 1 minute ago (default: “about a minute ago”).
time_more_mins : string – Time more than 1 minute ago (default: ” minutes ago”).
time_1_hour : string – Time approximately 1 hour ago (default: “about an hour ago”).
time_2_hours : string – Time approximately 2 hours ago (default: “a couple of hours ago”).
time_precise_hours : string – Time more than 2 hours ago (default: “about =x= hours ago”). NOTE: =x= should be used to insert the number of hours.
time_1_day : string – Time approximately 1 day ago (default: “a day ago”).
time_2_days : string – Time approximately 2 days ago (default: “almost 2 days ago”).
time_many_days : string – Time more than 2 days ago (default: ” days ago”).
time_no_recent : string – Output when there are no tweets to display (default: “There have been no recent tweets”).
NOTE: You can leave out any parameter to use the default, but be aware to change the unique id if you are using Output Anywhere in more than one place.