Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have looked around and can not find anything that fully works for my issue: I want to be able to set the home page template on the fly when a user is visiting from a mobile phone but not a tablet. I already have this check in place.

However I am able to change the whole theme on all pages when a visitor is on a phone but there does not seem to be a way to only change the template/theme on the home page.

Due to the only way I know for sure is checking is_front_page() which does not exist when you hook to change the theme. I also want to try to do this without redirecting to another page if possible.

share|improve this question
2  
Have you already tried something? How do you check for mobile users? Server-side or client-side? –  Mateusz Hajdziony Jan 7 '13 at 17:07

2 Answers 2

You could check for a mobile device using wp_is_mobile() and then include the right template part with get_template_part().

Header and footer can be styled quickly with a couple of css media queries.

share|improve this answer
3  
wp_is_mobile will not distinguish between phones and tablets. It is a very simple function. –  s_ha_dum Jan 7 '13 at 18:45

I think you can try something like this plugin - Any mobile Theme Switcher. You just need to upload a mobile theme and through this plugin you can choose which device should see which theme.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.