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.

Is it possible to use a child theme for mobile browsers?

I have tried various plugins but the mobile browser only displays the main theme, the theme that is meant for viewing the website on the desktop. My child theme inlcudes php as well as css files. Whenever I switch to a different theme for mobile browsers it works but the custom post types, cats etc are missing in action. I am kind of lost.

Any ideas there?

Thank you

P.S. I think the problem is that the browser detector doesn't recognize the child theme as a theme. It grabs the parent files instead of the child theme files.

share|improve this question
    
It is most definitely possible, but it is hard to say what your issue might be without knowing how exactly you try to conditionally switch theme. –  Rarst Apr 5 '11 at 19:17
    
I like the sound of most definitely possible. What would be the most common issue? –  Mia Apr 6 '11 at 6:20
add comment

3 Answers

My child theme inlcudes php as well as css files. Whenever I switch to a different theme for mobile browsers it works but the custom post types, cats etc are missing in action. I am kind of lost.

Your problem is that you're doing too much with the theme. Themes are all about presentation, not about functionality. If your child or parent theme is defining a custom post type (as I infer from your question), then you're doing it wrong.

When the mobile plugins serve up a different theme for your site, they ignore the main theme for your site entirely. That means no CPT support on the mobile side unless you rewrite the mobile plugin yourself.

So, instead, spin off your CPT definitions into a plugin so that they're still available to the mobile version of your site.

share|improve this answer
add comment

Check out this plugin:
WPTouch @ WordPress.org

I use it on my site and works great. Haven't looked into the code much yet, but it seems pretty straightforward.

share|improve this answer
    
Thank you notlaura, I tried almost every plugin out there. But I will try again. –  Mia Apr 6 '11 at 6:18
add comment

Seems like I was able to find a (temporary) solution. I activated the mobile smart plugin. Then, I made the child theme to a parent theme, meaning the child theme is now a separate theme that will be used as the mobile theme, and added the custom post types used in the main theme.

Another solution could be adding custom post data from the SQL database to the post query in the mobile theme. Works fine with custom fields. Just need to figure out how to add the custom post categories to the query.

share|improve this answer
add comment

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.