I’m building a custom theme, along with a custom mobile theme counterpart. They don’t share resources, CSS, etc. (cause I like to keep them clean, and separate).
My question is: how does everyone (preferably other professionals) go about doing this? I’m using the Mobile Detect script to redirect users to the ‘mobile’ sub-folder when they access the site via their mobile phone, etc. Is there another, more elegant way of doing this?
Personally I always tend to stick to using responsive design rather than a completely different theme. You then will only have theme to keep updated.
Check out this article for more information
http://www.techrepublic.com/blog/webmaster/how-to-get-started-with-responsive-web-design/1769
Will,
You can use the template include filter to redirect visitors to a different page template conditionally.
Example code to redirect a custom post type template:
Additionally, you can also use the
add_filter('template','get_your_new_theme');
to conditionally direct visitors to a different theme if they are on a mobile device. You are a little limited with what you can do here, but I have found it useful for some mobile sites.Here is some code I used as a plugin to direct mobile visitors to a different theme: https://gist.github.com/3454745