Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; WPShortcodeExecPHP has a deprecated constructor in /home/wescleveland/public_html/ on line 78

Deprecated: Function create_function() is deprecated in /home/wescleveland/public_html/ on line 190
More wp247 Body Classes - WordPress 24x7

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 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

  1. Wes May 7, 2015 at 12:47 pm

    Unfortunately, the answer is highly dependent on your website and the theme you are using. In general, use your browser’s ability to view the source of the page or inspect elements to see the html structure. Identify the id of the section to be hidden and then do something like: #id-of-mobile-section-to-hide {display: none;} #id-of-non-mobile-section-to-hide {display: none;}

    Hope this helps.


Leave a Reply

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




Theme by HermesThemes

Copyright © 2020 WordPress 24x7. All Rights Reserved