TxTu Is Mobile

TxTu Is Mobile is a Wordpress plugin that enables you to check if a visitor of your Wordpress blog is using a mobile device like for instance a Nokia, Sony Ericsson or Motorola mobile phone.

The plugin is extensible enough to allow the inclusion of other mobile devices. You can also turn off mobile device checking by enabling or disabling it in the plugin’s configuration screen.

Download

Download: txtu-is-mobile.zip
Current Version: 1.0.2
Updated: June 24, 2008
Size: 10.47 KB
Downloaded: 6 times

Installing the plugin

The procedure for installing the plugin is the same as any Wordpress plugin. Just unzip the file into the /wp-content/plugins/ directory. Then go to the WordPress Admin panel and click on “Plugins”. From the list of plugins look for the plugin named “TxTu Is Mobile”. Click on the “Activate” link to enable the plugin.

Once the plugin is enabled, go to “Settings / is_mobile()”. There are currently two options that you can configure.

The first option enables or disables the plugin. The other option is a comma separated list of strings that is tested to identify your blog’s visitor. You need to update the list to include the unique string that will identify the different mobile browsers that visit your site. Don’t worry about creating a complete list. You can always add them later.

How is it done

The is_mobile plugin works by comparing the “user agent” string of the browser of your blog’s visitor. If any one of the strings you inputted in the “Mobile Browser Strings” parameter is found in the visitor’s user agent string then the is_mobile() function of the plugin returns TRUE. Otherwise it returns FALSE.

You can use the is_mobile() function in your Wordpress theme to check if the visitor is a mobile user and perform actions based on the function’s return value (e.g. load a different stylesheet for mobile browsers, load an image with a different size for mobile devices …) The possibilities are limitless, just use your imagination.

If you need help just post a comment here and I’ll get back to you as soon as I can.

 

Comments

Leave a Reply

 
  • Text Message of the Day

    QRcode:4db886f3ac7b218a643e6344e0791e8d Do not go where the path may lead, go instead where there is no path and leave a trail.
    Read about 2D barcode images