Mobile Detector
A lightweight detector of mobile devices, OSs & browsers that, optionally, allows your site to switch to a mobile theme when a mobile device is detected or when your users feel like it. This plugin adds the class MobileDTS to WordPress. Mobile Detection On every request, this plugin will try to dete
A lightweight detector of mobile devices, OSs & browsers that, optionally, allows your site to switch to a mobile theme when a mobile device is detected or when your users feel like it.
This plugin adds the class MobileDTS to WordPress.
Mobile Detection
On every request, this plugin will try to detect if the user is viewing your site with a mobile device or not. If he is, the detector will also give you some info about the device, browser and OS used.
Who will be happy with this detector?
If you need a fast and reliable way to detect if a user is visiting your site with a mobile device, then you’ll be happy. However, if you need precise information about the device used (other than OS and browser) such as screen resolution you need a detector such as DeviceAtlas or WURFL .
How to query the detector?
Use the method MobileDTS::is($key) . is() returns boolean true or false .
Example:
<?php if (MobileDTS::is('android')) { // User with a mobile device running Android OS } else if (MobileDTS::is('ios')) { // User with a mobile device running iOS } else if (MobileDTS::is('mobile')) { // User with a mobile device (any, even 10 years old mobile phones) } else { // User with a desktop device } ?>
Available keys:
- mobile (Is it a mobile?)
- other (Any other mobile device)
Popular mobile devices
- iphone (Apple iPhone)
- ipad (Apple iPad)
- kindle (Amazon Kindle)
Mobile OS
- android (Android OS)
- bada (Bada OS)
- bbos (Blackberry OS)
- ios (Apple iOS)
- palmos (Palm OS)
- symbian (Symbian OS)
- webos (Hp WebOS)
- windows (Windows Phone OS and older)
Mobile browsers