A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links.
A widget that properly handles twitter feeds, including parsing @username, #hashtag, and URLs into links. It supports displaying profiles images, and even lets you control whether to display the time and date of a tweet or how log ago it happened (about 5 hours ago, etc).
- Use automatic installer to install and active the plugin.
- You should see a notice appear in your admin that links you to the settings page.
- Follow the instructions to setup your Twitter app and authenticate your account (an unfortunate step made necessary by Twitter's API changes).
- In WordPress admin go to 'Appearance' -> 'Widgets' and add "Twitter Widget Pro" to one of your widget-ready areas of your site
Can I follow more than one feed?
Absolutely, each instance of the widget can have different settings and track different feeds.
I get an error similar to "Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /.../wp-twitter-widget.php on line ##" when I try to activate the plugin. Is your plugin broke?
No. This error occurs because the plugin requires PHP 5 and you're running PHP 4. Most hosts offer PHP5 but sometimes you have to enable it in your control panel, through .htaccess, or by asking them. There may be instructions for your specific host in the Switching to PHP5 article in the codex.
How can I add this widget to a post or page?
You can now use the twitter-widget shortcode to embed this widget into a post or
page. The simplest form of this would be [twitter-widget username="yourTwitterUsername"]
How exactly do you use the twitter-widget shortcode?
The simplest form of this would be [twitter-widget username="yourTwitterUsername"]
However, there are more things you can control.
- before_widget - This is inserted before the widget.
- after_widget - This is inserted after the widget, and is often used to close tags opened in before_widget
- before_title - This is inserted before the title and defults to
- after_title - This is inserted after the title and defults to
- errmsg - This is the error message that displays if there's a problem connecting to Twitter
- hiderss - set to true to hide the RSS icon (defaults to false)
- hidereplies - set to true to hide @replies that are sent from the account (defaults to false)
- hidefrom - set to true to hide the "from ____" link that shows the application the tweet was sent from (defaults to false)
- avatar - set to one of the available sizes (mini, normal, bigger, or original) (defaults to none)
- targetBlank - set to true to have all links open in a new window (defaults to false)
- showXavisysLink - set to true to display a link to the Twitter Widget Pro page. We greatly appreciate your support in linking to this page so others can find this useful plugin too! (defaults to false)
- items - The number of items to display (defaults to 10)
- fetchTimeOut - The number of seconds to wait for a response from Twitter (defaults to 2)
- showts - Number of seconds old a tweet has to be to show ___ ago rather than a date/time (defaults to 86400 seconds which is 24 hours)
- dateFormat - The format for dates (defaults to'h:i:s A F d, Y' or it's localization)
- title - The title of the widget (defaults to 'Twitter: Username')
- showretweets - set to true to show retweets, false to hide them (defaults to true)
- showintents - set to true to show the reply, retweet, and favorite links for each tweet, false to hide them (defaults to true)
- showfollow - set to true to show the follow button after tweets, false to hide it (defaults to true)
You can see these put into action by trying something like:
[twitter-widget username="wpinformer" before_widget="<div class='half-box'>" after_widget="</div>" before_title="<h1>" after_title="</h1>" errmsg="Uh oh!" hiderss="true" hidereplies="true" targetBlank="true" avatar="1" showXavisysLink="1" items="3" showts="60"]Your Title[/twitter-widget]
[twitter-widget username="wpinformer" before_widget="<div class='half-box'>" after_widget="</div>" before_title="<h1>" after_title="</h1>" errmsg="Uh oh!" hiderss="true" hidereplies="true" targetBlank="true" avatar="1" showXavisysLink="1" items="3" showts="60" title="Your Title"]
[twitter-widget username="wpinformer"]
How can I style it to look nicer?
There are plenty of CSS classes throughout the HTML that is generated, and you can use those to style things. Here is some sample CSS that I use with the Essence Theme. You'll need to get the "Everything" sprite from Twitter's Image Resources. ` .widget_twitter div { padding:0; }
.widget_twitter ul li { margin-bottom:5px; }
.widget_twitter .follow-button, .widget_twitter .xavisys-link { margin:0 10px 10px 25px; }
.widget_twitter .entry-meta { display:block; font-size:80%; }
.widget_twitter .intent-meta a { background: url(images/everything-spritev2.png); /** from Twitter ressources */ display: inline-block; height: 16px; text-indent: -9999px; width: 16px; } .widget_twitter .intent-meta a.in-reply-to { background-position: 0 center; } .widget_twitter .intent-meta a:hover.in-reply-to { background-position: -16px center; } .widget_twitter .intent-meta a.favorite { background-position: -32px center; } .widget_twitter .intent-meta a:hover.favorite { background-position: -48px center; } .widget_twitter .intent-meta a.retweet { background-position: -80px center; } .widget_twitter .intent-meta a:hover.retweet { background-position: -96px center; } `
Why can't I display a friends feed anymore?
Apparently the database queries required to display the friends feed was causing twitter to crash, so they removed it. Unfortunately, this is outside my control.
- Remove screen icon code
- Update WordPress Twitter helper class
- Update Twitter oAuth class
- Load class files conditionally
- Move to a static text domain
- Move away from my plugin framework
- Fix a leftover Range link
- Use __contrsuct instead of WP_Widget->WP_Widget
- Move away from Range
- Ability to test loop back requests...consider this beta :)
- Removes even opt-in credit link
- Add ability to remove accounts
- Fix bug that made lists not work
- Work around PHP bug in json_decode() - https://bugs.php.net/bug.php?id=45989
- Fix some strict standards warnings
- Minor fix for a strict PHP notice
- Don't force verification of Twitter's SSL certificate
- Add support for Twitter Lists in shortcodes
- Don't force verification of Twitter's SSL certificate
- Fix empty admin notice
- Fix bug with retweets not being ignored
- Fix hashtag links
- Rename OAuthUtil class to twpOAuthUtil
- Don't use 'account/verify_credentials' as it has a very low limit
- Use the new Twitter API with oAuth
- No longer supports non-https Twitter requests (Twitter API requirement)
- Make sure hashtags are parsed UTF-8
- Add German translation
- Better linking of URLs, especially handling of punctuation at end of URLs
- Support for extended characters in hashtags
- Allow externally linked images to serve via ssl
- More efficient regex for link parsing
- Link FTP links
- Link E-Mail addresses
- Complete conversion to Range plugin framework from Xavisys framework
- Added place to check API usage
- Fix issue with "Include Retweets" not unchecking
- Update feeds and links to Ran.ge
- Move assets to assets dir
- Pull in some Range branding to replace Xavisys branding
- Display dates based on your WordPress timezone setting
- Pass $tweet to widget_twitter_content filter
- Fix issue with mixed content warning on HTTPS pages
- Add option to clear TLC update locks
- Make sure we didn't get a string from json_decode()
- Added a setting to allow using the Twtter API via HTTP or HTTPS
- Fixed support forum links
- Small alignment adjustment on settings page
- Added an Arabic translation - Thanks Yaser Maadan - http://www.englize.com
- Fix conflict with Jetpack by disabling their Twitter widget
- Updated TLC to fix issue where updates could get stuck "locked"
- Add data-lang support for Twitter intents
- Updated Italian translation - Thanks Gianni Diurno - http://gidibao.net
- Fix some strings that were not translatable
- New Italian translation Thanks to Gianni Diurno - http://gidibao.net
- Fixes issue with saving a couple of the settings (tweet intents and follow button)
- Integrate Mark Jaquith's TLC Transients https://gist.github.com/1149945 which lets us only get rid of old tweets once we have successfully received new ones.
- Add Twitter Web Intents (reply, retweet, favorite)
- Add option for Twitter Follow button
- Fix issues with saving avatar sizes
- Remove "Hide RSS Icon and Link" option - Decisions not options.
- Removed link from title. Use the follow button option or if you have unfiltered_html privileges you can enter the HTML link as the title.
- Use the new API URLs
- Use the new "hide replies" option in the Twitter API
- Add support to show retweets
- Add support for multiple profile image sizes
- The Twitter-pocolypse hit a while back but since so many servers are 64 bit it wasn't an issue. This fixes links for users on 32 bit servers.
- Fix some notices thrown by translated strings
- Fix issue introduced in 2.2.1 with an incorrect function name '_hashtagLink' (sorry about that)
- Add missing space between "from" and "in reply to"
- Add the ability to remove the "from" links from displaying - Thanks to Joost de Valk for the request and the patch!
- Now uses the Xavisys WordPress Plugin Framework - http://bluedogwebservices.com/xavisys-wordpress-plugin-framework/
- Added an options page where you can set defaults that apply to widgets, shortcodes, and php calls (everything can be overridden)
- Added the Xavisys feed to the dashboard (which can be hidden using the screen options)
- Fixed problem for people with certain WP configs and PHP 5.0-5.1.x that caused the Services_JSON class to get included twice.
- Fixed issue with urls in the form www.site.com
- Mixed-case attributes now work properly in the shortcode
- Fixed issue with matching only @ as a username
- Fixed extraneous closing tag that caused invalid HTML
- You can now specify your own date format as a per-widget option
- Fixed spacing issue that was introduced in 2.1.1
- Added links to the Support Forum
- Added an option to open links in new windows
- Added a shortcode to allow you to embed a widget in any post or page
- Remove the settings link from the plugin line on the plugins page
- Add a link to manage widgets to the plugin line on the plugins page
- Make date string translatable
- Added twitterwidget-title and twitterwidget-rss classes to the title and rss links for separate styling
- Removed the optional anonymous statistics collection. Nothing is ever collected anymore.
- Removed some whitespace that was messing up styling for some people
- Fixed Profile image error
- Added another FAQ (about PHP 5)
- Fixed problem with invalid actions introduced into 2.0.0
- Completely rewitten to use the new widget class introduced in WordPress 2.8
- Now uses the json class that will be included in WordPress 2.9 for anyone on PHP < 5.2
- The "Show Link to Twitter Widget Pro" is now off by default to comply with the latest decisions regarding the plugin repository
- Re-enables the caching that got inadvertantly disabled in 1.5.0.
- This is an attempt at catching an elusive error. If you're getting an error referencing line 332, please try this new version.
- Fixed an uncaught exception that could occur starting in 1.4.8
- The HTML has been changed for displaying profile images. If you show profile images, you may need to update your CSS accordingly
- Changed name of widget from "Twitter Feed" to "Twitter Widget Pro"
- Fixed issue with calculation of "time since" for tweets that were months old
- Properly registering settings, should fix problem with WPMU
- Added ability to hide @replies from your widget
- Switched to using date_i18n so dates are localized
- Added Danish translation - Props Georg
- Add ability to give more information on WHY you should upgrade on the plugins page
- Fixed PHP notice when you add a new copy of widget to your sidebar
- Added the text domain to some translatable strings that were missing it
- Added the Spanish translation thanks to Rafael Poveda !! (Really....thanks for being the first translator for this)
- Thanks to RaveN and Dries Arnold for pointing out that the "about # ____ ago" phrases weren't translatable
- Fixed some translatable strings
- Fixed readme text
- Make translatable
- Include POT file
- Remove JS submitted for for stats and use HTTP class instead
- Added some spans with classes to make styling to meta data easier
- Fixes issue with linking URLs containing a ~
- Removed some debugging stuff
- #Hashtags are now linked to twitter search
- Added convert_chars filter to the tweet text to properly handle special characters
- Fixed "in reply to" text which stopped working when Twitter changed their API
- Some configs still couldn't turn off the link to Twitter Widget Pro page
- Fixed problem with link to Twitter Widget Pro page not turning off
- Added error handling after wp_remote_request call
- Added link to Twitter Widget Pro page and option to turn it off per widget
- Updated to use HTTP class and phased out Snoopy
- No longer relies on user having a caching solution in place. Caches for 5 minutes using blog options
- Allow HTML in title and error message if user can
- Fixed minor issue with Zend JSON Decoder
- Added an option for Twitter timeout. 2 seconds wasn't enough for some people
- Fixed some minor errors in the collection code
- Added the admin options page (how did that get missed?!?)
- Removed friends feed option, twitter removed this functionality
- Added an option to set your own message to display when twitter is down
- Added optional anonymous statistics collection
- Added an error if there was a problem connecting to Twitter.
- Added some text if there are no tweets.
- Fixed validation problems if source is a link containg an &
- Title link always links to correct username, rather than the last person to tweet on that feed
- Added option to hide RSS icon/link
- Fixed issue with @username parsing of two names with one space between them (@test @ing)
- Fixed readme typo
- Most major fix is the inclusion of json_decode.php for users that don't have json_decode() which was added in PHP 5.2.0
- Fixed problem with displaying a useless li when profile images aren't displayed on a single user widget
- Default title is now set to "Twitter: UserName"
- Released to wordpress.org repository
- Fixed some of the settings used with Snoopy
- Set a read timeout for fetching the files
- Changed some function names
- Moved form display to a separate function (_showForm)
- Now uses wp_parse_args to handle defaults
- Added comments
- Added seconds to the _timeSince function so you can have something like "about 25 seconds ago"
- Original Version