Well, the wp247 Body Classes WordPress plugin has been out for a couple of weeks now and a few people have started using it. One person asked if it could indicate whether or not a mobile user is on a tablet. The simple answer was No. But not any longer.

Unfortunately, there is no easy way to determine the mobile device type. But, after a bit of searching, I came across a great little script from mobiledetect.net called, you guessed it, MobileDetect. This script does a lot of interrogation of the HTTP_USER_AGENT string to determine all types of mobile attributes – including if it is a tablet.

wp247 Body Classes now supports adding classes to your <body> tag based on the MobileDetect script. So, now you can go really crazy, like tailor your web design based on .is-tablet vs. .is-phone, or .is-ipad vs. .is-kindle, or .is-ios vs. .is-androidos, or .is-chromebrowser, or (well, you get the idea).

Hope this comes in handy for someone. And, if you have any other ideas of Body Classes that you would like to see added to wp247 Body Classes, then please drop us a line.


One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *




Theme by HermesThemes

Copyright © 2022 WordPress 24x7. All Rights Reserved