Fatal error: Cannot redeclare wp_is_mobile()

Solution:1

Got it!

In wp-content\plugins\sitepress-multilingual-cms\sitepress.php, there is the following lines

if ( function_exists(‘is_multisite’) && is_multisite() ) {
include_once( ABSPATH . WPINC . ‘/vars.php’ );
}
This lines include the file /wp-includes/vars.php where the function wp_is_mobile() is declared. Then WordPress include this vars.php file again and produce an logical error.

Before WP 3.4 release there was no visible problem as there was no functions into vars.php. But now there is.

I think wpml doesn’t need to include this file as it’s already include by WordPress.

So a bypass can be : Comment lines 21-24 in “wp-content\plugins\sitepress-multilingual-cms\sitepress.php”

Hope WPML can fix it more proprely in next plugin release.

Solution:2

Not being able to see the code of your theme, I’m guessing your functions.php includes a function declaration like this:

function wp_is_mobile() {
   // ... the code
}

So what you’re going to need to do is wrap that function, like this:

if (function_exists('wp_is_mobile')) {
    function wp_is_mobile() {
       // ... the code
    }
}

Either that or simply rip out the duplicate in the theme and use the version in 3.4.

I would guess your theme provider will update that theme, that kind of conflict is nasty. This is why theme developers are encourages to prefix their functions with something unique. Prefix everything.