Twitter Widget not working on mobile devices

Fix for wordpress twitter widget not loading on mobile devices

twitter-widget-mobile(iPhones, Android, Blackberry… etc.)

On mobile devices, we noticed our twitter widgets weren’t loading. This problem is caused because twitter.com automatically forwards mobile devices to mobile.twitter.com

Since the “twitter-widget.php” file links to the source file “http://twitter.com/javascripts/blogger.js”, on mobile devices it will link to a file that does not exist, resulting in the following error:

“Failed to load resource: the server responded with a status of 404 (Not Found) | mobile.twitter.com/javascripts/blogger.js”

The solution for this is to host your own blogger.js file:

1. Download/Save blogger.js and upload to your website under:
wp-content/themes/YOUR_THEME/javascript/blogger.js

2. Change one line of twitter-widget.php:
/wp-content/themes/XXXXX/include/plugin/custom-widget/twitter-widget.php (This plugin came packaged in the theme)

Find this line

[sourcecode language=”php”]
<script type=”text/javascript” src=”http://twitter.com/javascripts/blogger.js”></script>
[/sourcecode]

Change it to this

[sourcecode language=”php”]
<script type=”text/javascript” src=”http://YOUR_WEBSITE.com/wp-content/themes/YOUR_THEME/javascript/blogger.js”></script>
[/sourcecode]

Twitter widget not loading on WordPress UPDATED June 2013

Fix for wordpress twitter widget not working or stuck on loading. UPDATED June 2013

Wordpress Twitter Widget Not Loading

The Twitter API v1 has been retired, and this means some functionality has been removed. As of now all twitter widgets need to be properly authenticated with OAuth as Basic Auth has been disabled. This breaks most of the Twitter widgets we use. The easiest fix now is to replace your twitter widget entirely. I recommend using the Really Simple Twitter Feed Widget.

Once the Really Simple Twitter Feed Widget is installed you need to configure it with your OAuth keys. To get these keys go to https://dev.twitter.com/apps and sign in using your twitter account. Here you will need to create a new app for the widget. Create the app and it will generate the keys. Then Click the Create Access Token button and then refresh the page to get the Access Token. Fill out the WordPress widget settings with the keys and your twitter username and everything should be working.

If you use seaofclouds / tweet jquery.tweet.js check out Stan Scate’s fix here: https://github.com/StanScates/Tweet.js-Mod

The Twitter API has been recently updated and this started to affect some of our WordPress websites that use the GoodLayers Twitter Widget. The problems arose because of these changes to the Twitter API posted by @kurrik:

  • All non-versioned API endpoints will go away. Though you may occasionally find these endpoints responding as we ramp down, expect them to be gone in two weeks. This list includes:We’ll be removing support for the public timeline: api.twitter.com/1/statuses/public_timeline.
    • All API endpoints on www.twitter.com and twitter.com.
    • Endpoints on api.twitter.com without /1, /1.1 or /oauth in the fully qualified URL.

This caused the Twitter Feed to not load. The fix involves tweaking one line of twitter-widget.php

/wp-content/themes/XXXXX/include/plugin/custom-widget/twitter-widget.php (This plugin came packaged in the theme)

Find this line

Change to this

The api subdomain has been added to the src string as well as versioning (1). Version 1.1 of the Twitter API will be rolling out in March 2013.