View category web

Fixing Twitter Tools on multisites

So, I couldn’t get Twitter Tools to work properly. It was constantly giving me “No tweets available at the moment.” After a lot of head banging and not really much information coming from the interwebs, I started to look at the backend of my installation.

A couple of online blogs and forums suggested uninstalling, deleting and reinstalling the plugins. Others suggested dropping the ‘ak_twitter’ table from the database, then uninstalling, deleting and reinstalling the plugins. None of this worked, but it got me on the path of looking at the database. I noticed that, as this is a multisite setup that the prefix to the ak_twitter table was the default, but each other table for each of the multisites had a number appended to the prefix. A quick look at the Twitter Tools code, and I was able to output the table name with the text ‘Tweets updated.’ when I clicked the ‘Update Tweets’ button. Sure enough, the expected table name had the number of the multisite appended to the prefix (so instead of outputting ‘prefix_aktt_twitter’ as the table name, I got ‘prefix3_aktt_twitter’). As this table didn’t exists, the tools couldn’t populate it, and my Twitter widget was like the Nazis in “Raiders of the Lost Ark”; it was looking in the wrong place.

I had to manually add the table name to the Twitter Tools code. If you need to do this, the table name is generated in three places. Do a search for $wpdb->aktt = $wpdb->prefix.'ak_twitter' and replace it with $wpdb->aktt = 'prefix_ak_twitter' (obviously, replace the prefix with whatever you set it to on your installation, by default it’s ‘wp_’).

Once this corrected code is on the server, go into your Twitter Tools, Reset Tweet Checking and the Update Tweets. Once the widget is on your site, you should get your Twitter feed as expected.