Creating a mobile site by adding a new class to the body tag from functions.php

The code below works, basically it adds your class to the wordpress body_class() array..

add_filter('body_class','my_class_names');
function my_class_names($classes) {
    // add 'class-name' to the $classes array
    $classes[] = 'mobile';
    // return the $classes array
    return $classes;
}

You can read more on this on the WP codex here