Fix: WPtouch Pro Plugin Breaks WordPress 3.1’s Admin Bar

WordPress 3.1 rolled out today and brought with it several new features, one being the WordPress admin bar. This feature has been previously available to WordPress.com users and is now available to self-hosted sites (like Techerator), and gives logged-in users access to page controls without having to leave the site.

Sites that use the popular WordPress plugin WPtouch or WPtouch Pro will notice that this plugin breaks the new admin bar. While WPtouch is active, the admin bar will not appear on the main site or in the WordPress Dashboard (it took quite a bit of troubleshooting to narrow down which plugin was the culprit!).

The fix is very simple, and the team behind WPtouch has confirmed they are aware of the problem and intend to fix it.

The Fix

This guide requires that you edit plugin files in your WordPress installation. If you do not feel comfortable following this guide, please seek assitance before proceeding. And above all – make a backup!

Step 1: Navigate to the WPtouch plugin themes folder on your web server. Mine was located in /wp-content/plugins/wptouch-pro/themes/classic (If you’re using a different mobile theme, select that instead of classic.)

Step 2: Edit root-functions.php

Step 3: Locate the following code:


if ( function_exists( 'show_admin_bar' ) ) {
add_filter( 'show_admin_bar', '__return_false' );
}

And comment it all out:


//if ( function_exists( 'show_admin_bar' ) ) {
//    add_filter( 'show_admin_bar', '__return_false' );
//}

That’s it! Your WordPress 3.1 admin bar should now be visible on your site. To enable or disable the admin bar, visit your User settings under Users –> Your Profile in WordPress.