Function for the plugin WP Mobile Detect. This plugin will detect if the site is being view on a mobile phone and allow you to deliver different content.
Use the following code to show content on a mobile device:
This is shown on a phone
This is shown on everything but a phone
The following will show on everything but a mobile device:
This is shown on everything but a phone
Swap out the above code with the following functions for different effects.
wpmd_is_notphone() – Returns true when on desktops or tablets
wpmd_is_nottab() – Returns true when on desktops or phones
wpmd_is_notdevice() – Returns true when on desktops only
wpmd_is_phone() – Returns true when on phones ONLY
wpmd_is_tablet() – Returns true when on Tablets ONLY
wpmd_is_device() – Returns true when on phones or tablets but NOT desktop
wpmd_is_ios() – Returns true when on an iOS device
wpmd_is_iphone() – Returns true when on iPhones
wpmd_is_ipad() – Returns true when on iPads
wpmd_is_android() – Returns true when on Android
wpmd_is_windows_mobile() – Returns true when on Windows Mobile
wpmd_is_blackberry() – Returns true when on Blackberry
wpmd_is_chrome_browser() – Returns true when on mobile Chrome browser
wpmd_is_safari_browser() – Returns true when on mobile Safari browser
wpmd_is_opera_browser() – Returns true when on mobile Opera browser
wpmd_is_ie_browser() – Returns true when on mobile Internet Explorer browser
wpmd_is_firefox_browser() – Returns true when on mobile Firefox browser
Download Mobile Detect here: https://wordpress.org/plugins/wp-mobile-detect/