I created two WordPress themes.
First for the Desktop and second for tablet/mobile. I want to set on one URL. When the website opens, the theme should change automatically based on resolution.
I created two WordPress themes.
First for the Desktop and second for tablet/mobile. I want to set on one URL. When the website opens, the theme should change automatically based on resolution.
Comments are closed.
To employ two entirely separate themes is a suboptimal architectural approach.
Themes are activated site-wide/globally and not on a per-user basis. You don’t want to change the current theme constantly.
While I personally really dislike this option, WordPress ships with a function that sniffs the UA-String,
wp_is_mobile
.This function can be employed to either output alternative markup and/or load an alternative stylesheet (from within the same theme).
Or – and this is my personal choice – familiarize yourself with CSS3 mediaqueries.
For simple, you may try this plugin,
http://wordpress.org/plugins/device-theme-switcher/
See this thres also,
How to detect mobile devices and present them a specific theme?
for more customization have to play with code to manipulate the options table meta values for ‘stylesheet’, ‘template’.