This option will reset the home page of this site. Restoring any closed widgets or categories.

Reset

How to detect mobile visitors on your WordPress blog

VN:F [1.8.3_1051]
Rating: 6.0/10 (1 vote cast)

As mobile devices, as such as Blackberries or iPhones, are becomming more and more popular, bloggers may want to detect those visitors and redirect them to a mobile version of their blog. Here is a recipe to detect mobile visitors.

Post Pic

To achieve this recipe, you first have to get the code from detectmobilebrowsers.mobi and upload it to your theme directory.

Once done, simply open your header.php file and place the following at the top of the file. Don’t forget to edit line 5 according to the page where you’d like to redirect mobile users.

include('mobile_device_detect.php');
$mobile = mobile_device_detect();

if ($mobile==true) {
  header( 'Location: http://your-website.com/?theme=Your_Mobile_Theme' ) ;
}

Thanks to Jeff Starr for this very cool idea!

By the way, did you checked out the Headway theme for WordPress? It is pretty amazing. I’ll publish a review about it soon at Cats Who Blog.

VN:F [1.8.3_1051]
Rating: 0 (from 0 votes)
How to detect mobile visitors on your WordPress blog6.0101
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Add to favorites
  • BarraPunto
  • Bitacoras.com
  • BlinkList
  • blogmarks
  • blogtercimlap
  • connotea
  • Current
  • Design Float
  • Diggita
  • Diigo
  • DotNetKicks
  • DZone
  • eKudos
  • Fark
  • Blogosphere News
  • email
  • Faves
  • Fleck
  • FriendFeed
  • FSDaily
  • Global Grind

Leave a Reply

You must be logged in to post a comment.