WP Mobile Detect
One of the hardest parts of building Responsive WordPress themes is maintaining responsive integrity after the site goes live. User Admins can have limited coding abilities which can prevent them from maintaining responsiveness in themes. WP Mobile Detect aims to make it extremely easy for anyone to
One of the hardest parts of building Responsive WordPress themes is maintaining responsive integrity after the site goes live. User Admins can have limited coding abilities which can prevent them from maintaining responsiveness in themes.
WP Mobile Detect aims to make it extremely easy for anyone to wrap content in the editor with shortcodes which will hide content based on visitor device at the server level.
No longer do we need to rely on display:none; or other techniques to hide content for mobile devices. Instead we can replace content with alternatives. When a full-size infographic in your post is unknowingly displayed on a visitors phone we can consider that an Non-user initiated download. In other words that visitor had no idea what they were getting into and you possibly just choked their bandwidth.
WP Mobile detect gives you the ability to wrap that infographic in a [notdevice][/notdevice] shortcode so at the server level WordPress will decide to show that content only if the user is NOT on a phone or tablet. Alternatively you can wrap a link and corresponding text to that info graphic in a [device][/device] shortcode as a way for the visitor to consume that content if they so choose.
This plugin is based on the PHP Mobile Detect class WordPress Plugin written by Jesse Friedman
This section describes how to install the plugin and get it working.
e.g.
- 01Upload the wp-mobile-detect folder to the /wp-content/plugins/ directory
- 02Activate the plugin through the ‘Plugins’ menu in WordPress
- 03Start using the shortcodes in your content or functions in your theme
Frequently asked questions.
What shortcodes are available with this plugin
[phone]Put content here that you only want displayed on Phones NOT Tablets or Desktops[/phone] [tablet]Put content here that you only want displayed on Tablets NOT Phones or Desktops[/tablet] [device]Put content here that you only want displayed on Phones OR Tablets NOT Desktops[/device] [notphone]Put content here that you only want displayed on Tablets OR Desktops NOT Phones[/notphone] [nottab]Put content here that you only want displayed on Phones OR Desktops NOT Tablets[/nottab] [notdevice]Put content here that you only want displayed on Desktops NOT Phones OR Tablets[/notdevice] [ios]Put content here that you only want displayed on iOS devices[/ios] [iPhone]Put content here, that you only want displayed on iPhones[/iPhone] [iPad]Put content here, that you only want displayed on iPads[/iPad] [android]Put content here, that you only want displayed on Android devices[/android] [windowsmobile]Put content here, that you only want displayed on Windows Mobile devices[/windowsmobile] [blackberry]Put content here, that you only want displayed on Blackberry devices[/blackberry] [chrome]Put content here, that you only want displayed on mobile Chrome browsers[/chrome] [safari]Put content here, that you only want displayed on mobile Safari browsers[/safari] [opera]Put content here, that you only want displayed on mobile Opera browsers[/opera] [firefox]Put content here, that you only want displayed on mobile Firefox browsers[/Firefox] [ie]Put content here, that you only want displayed on mobile Internet Explorer browsers[/ie]