It’s doable with a user agent string “sniffer”. Take a look at this project: http://mobiledetect.net
Mind you, this approach can be troublesome as most modern browsers can ‘fake’ their user agent strings. Also, this approach doesn’t work to well with caching systems.
I’ve implemented it successfully on a project I worked on, and I know it’s possible but it has some caveats. If you’re willing to overlook those small problems, I personally think this is the way to go (at least until WordPress gives us the proper tools to create better [and faster] websites).
Related Posts:
- Using classes instead of global functions in functions.php
- How to insert a logo in the header?
- Page template in two level deep folder
- Template for individual post designs
- How can I get wp_head() as a string instead of echoing it?
- Front End Post Submit Form
- Returning Variables back into a template
- Upgrading a custom theme through the Dashboard
- Theme Customizer not loading
- How to retrieve an image from a post and display it before excerpt of a post? [duplicate]
- Version control for both Vagrant config and themes being developed [closed]
- How to correctly add JQuery in a WP theme?
- What is the best way to handle multiple calls to get_template_directory_uri() and similar functions?
- How to add a second stylesheet to the editor
- WP 3.1 upgrade breaks AutoFocus+ theme
- create-guten-block in wordpress theme?
- Override template file i subfolders
- Single Page theme [closed]
- How to make theme elements customizable in wordpress?
- Limitations when modifying wp_title with a filter
- How to edit theme functions file to modify pagination?
- Customizer: save setting/control content to post/page
- Move default page templates to sub directory
- Customize how a WordPress theme looks like in the Theme Selector
- Customizer – loading settings/controls/sections/panels based on a id/page id
- Integrate WooCommerce theme with a WordPress theme [closed]
- Widget Option is Missing
- How do you use WordPress for a website that’s not in a blog format?
- How do I get the trackback count of a post in wordpress without writing an SQL query?
- Template for landing pages
- How to add menù section to my WordPress template?
- Why still output /wp-content/themes/twentynineteen?
- searchform.php doesn’t work properly
- Customizer: get_preview_url() inside customize_save_after hook
- How to add custom meta box when you have a custom page template file
- New to WordPress – Read the Codex, Other Docs; Still Confused
- How to add custom page elements to the WYSIWYG editor?
- Can’t change theme name
- How to hide custom sidebar on mobile
- Change Image Sizes for Mobile Theme
- Is hand coding required at all?
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- How to dowload and edit content of a website
- Any way to permanently translate themes?
- How to prevent XSS attack in wordpress theme?
- Show posts from all categories
- Best strategy for providing theme options using customizer
- How Does One Create a Global Variable Repository
- How to convert that page to a wordpress template? [closed]
- Turning WordPress Into full-featured website?
- Best practice to create required pages
- How customizable is a self-hosted WordPress blog compared to a Blogger blog?
- What is the point of using the front-page.php template? [closed]
- Meaning of “if ( is_home() && ! is_front_page() )” snippet?
- How To Add New Option Types To Option Tree?
- Where do I find the functions triggered within a hook?
- Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying
- How do I get a parent theme modification from a child theme?
- Removing the default sidebar from admin panel
- Extend walker – navigation, adding data attribute to a tag
- how to pull wordpress post comments to a external page
- Can I apply a WP theme to a specific custom page template?
- Best practices: Custom theme sidebar menu – hardcode or widget?
- Is it a good idea to make whole theme widgetized?
- How i can get widgets areas working in customizer?
- Theme development question regarding layouts
- Cannot figure out how to overwrite files in child theme
- which is the best way to customize nav-menu-template.php?
- wp-cli: For development, how can I activate a theme that is on the local disk but not zipped?
- My Admin bar covers my sticky navbar [closed]
- Single Page Design, Storing in Theme Options
- Edit footer via customizer
- Migrated WordPress site renders Chinese
- How to Find the Page the Front Page is Using?
- Load sidebar template just once to prevent multiple animations
- 3 Level Deep Navigation Menu Not Showing All Levels
- How to Have a Pure HTML Sub Directory In WP Site
- Random white space before doctype
- What are the critical theme files when building a custom theme?
- Having issue with WordPress wp_enqueue_style
- How add built-in textarea in theme development?
- Confused by the behaviour of “front page” / “home” templates
- Get video from the post on homepage
- WordPress Themes Directory: Template which hits the standards?
- How to custom category template based on category?
- How to change a local wordpress installation xml export file urls? and change them to what if you don’t have a live website?
- How to make menus, footer, sidebars multi language
- Different templates for each category level
- Child theme in separate WordPress Install
- How to show children pages as array
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- Using Customizer value in an external PHP file inside a theme
- Import from HubSpot COS into WordPress 4?
- WordPress 3.5 + Foundation 5 not working on IE9
- Theme automatically inserting “more” tag on every post
- How get the 10 most viewed pages (not post)
- Using wp_enqueue_script with social media buttons?
- How to create full header but keep content narrow
- Correct way to make a custom block theme responsive
- What is the point of using archive.php instead of index.php?