Child Theme for Mobile Browsers

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.

Read More

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.

Related posts

Leave a Reply

3 comments

  1. 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.

  2. 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.