This isn’t really a WordPress question…but instead of re-inventing the wheel take a look at this. I use it in any of my sites where I need to detect mobile device, and it works great. I see on their page they even mention there are WP plugins that use this code.
Related Posts:
- Proper usage of wp_is_mobile()?
- How to restrict attachment download to a specific user?
- How-to make the admin area mobile friendly [closed]
- How-to add rewrite rules to point the uploads folder to a subdomain
- Using JWT to authenticate a user with an external system?
- Allow anonymous user to access Themes Customizer
- Is there an existing capability to allow editing of only pre-existing pages? If not, a good way to implement this?
- How to make user inactive by default while registering?
- How can i disable a plugin for a mobile phone?
- How to set privilege to wordpress subscriber for private page
- How to switch css files according to devices and button click?
- authenticate user without password from email activation link [duplicate]
- User Access Manager plugin
- How can we Restrict to access a certain wordpress page to all ip address except some which we allow
- Convert WP Menu to a Drop Down for Mobile browser
- Restrict post to user_id
- add_option_page capability behaving strange
- Access denied on Published Pages but not on WordPress /wp-admin/
- Allow non logged users to visit only login page and password reset page
- How can I allow users to make groupings of posts
- Is user listing on wordpress private?
- How to restrict logged user to view only certain pages?
- Limit post display to post authors and create an exception for specific pages
- Multiple amp-image overlays. How to properly do this in wordpress?
- Mobile issue – website isn’t properly detecting screen size [closed]
- Using SRCSET with Images and Featured Images
- Old Site displays on Mobile View, not New Site
- Elements floating on top of each other when Resizing or checking site on mobile. Twenty Twelve
- How to “Global Ignore” / “Hell Ban” someone, restrict post visibility to the author only?
- Conditional menu for registerd users/guests (Genesis framework)
- How can I create an upload page for (and only visible to) specific users?
- My website is not responsive on mobile devices
- Best method for loading content on mobile – issue with wp_is_mobile
- Disabling Wp_is_mobile from backend?
- Why is only one page responsive? [closed]
- How to load different homepage on Mobile.?
- remove wp admin menu by customer user role
- Custom Roles for access to specific term(s)
- ‘post’ only for editor and administrator
- Serve a different theme based on window size
- Why: sticky front page code, shows latest non-sticky on logged-in front page
- Access denied error when logged in as admin
- Disable all admin UI access to authors (except to custom post type add, edit and modify)
- Hide all pages except landing page
- Change Header Image on Blog Post for Mobile View
- Menu toggle bar works only on some pages in WordPress
- How to restrict access to a page?
- Open Menu is not working in Mobile view [closed]
- How can I change access permissions across many pages?
- Disable Media File Image Link On Mobile Devices
- Change Image Sizes for Mobile Theme
- $is_iphone – to redirect a page
- Profiles site with access levels
- User access control in sidebar archive and categorires
- Twenty Eleven Theme Adjusts for iPhones. How to stop this feature?
- Plugins that restrict access based on user group/roles
- Efficient wp mobile menu
- Button and Countdown overlapping mobile menu
- Restrict access for wp-admin panel
- Specify the level of access to different pages at the time of user creation
- Shortcode function not showing up on mobile browser
- Mobile menu displays submenus on top of parent. Need it to display right below on an own line
- When add analytics script, wordpress user login not working
- How to make in wordpress a gallery with 3 colums to 1 on mobile devices responsive?
- How to center entire columns on a page, and have it stay responsive?
- Disable rendering of objects on mobile/above certain screen resolution
- New Styles Not Rendering On Mobile Phone and Tablet
- Hide WordPress “wp-admin” dashboard to User IDS
- Decide how Hero image appears on mobile
- Responsive images with srcset
- How can I hide/show text only for mobile users?
- I cannot access but but wp-admin works normally
- about visibility in wordpress regarding of roles
- Can access main URL and Dashboard but not any posts or pages [closed]
- Sidebar widgets are over the content in mobile mode, how can I fix it? [closed]
- responsive website
- menu mobile show up even i in desktop mode in Newspaper Theme
- Should I detect the device or the page first?
- How to List only the users created by a particular user
- How to enable to the user send content and save as draft entry?
- How to give members access to their own protected page?
- Use WordPress engine for user registration and management
- How to make future posts visible to selected visitors without login
- Add existing user as administrator
- Split post edit screen into sub-edit screens for users, is this good or bad, and is it possible?
- Suggestions for allowing basic users to view their own posts?
- How to restrict posts only from a certain category
- Navigation menu, remove item from desktop
- Custom page template not working on mobile
- How can I only show one responsive menu on mobile devices?
- Two users attempt to modify a page
- Allowing specific users to only add posts using certain custom taxomy terms
- How to get attachment id of background image?
- YouTube video goes over sidebar [closed]
- My theme header is stuck on a low resolution image?
- Mobile Menu not working on TwentyThirteen child theme
- Hiding site title for Twentyfifteen sidebar on (responsive) desktop display size
- How to give access to programmer/developer to make changes, but prevent undesirable changes? [closed]
- Understanding responsive imagery
- Remove one srcset entry from wp_get_attachment_image