Not that I’m aware of but have you tried looking for a responsive theme?
I would prefer child themes for mobile and tablet devices but the theme I’m using now has 35K CSS file and the template files are around 25K to 40K. Plus there are blocks that are designed for desktop mode and I would have to create a special block for mobile and use CSS to hide one block, etc.
A responsive theme is not out for me, just as a last resort.
So far, I found a way to switch to child themes on mobile devices:
# Parent Theme
add_filter( 'template', 'my_mobile_template', 99999, 1);
function my_mobile_template($template){
if(wp_is_mobile())
return 'mobile_template_dir_name';
return $template;
}
# Parent or Child Theme (if applicable)
add_filter( 'stylesheet', 'my_mobile_stylesheet', 999999, 1);
function my_mobile_stylesheet($stylesheet){
if(wp_is_mobile())
return 'mobile_stylesheet_dir_name';
return $stylesheet;
}
So far, it pulls the CSS from the child theme. Is there a way to use the header.php in the child theme instead of the primary?
Have a look at some of the theme switcher plugins. Maybe there’s code in there that you can re-use.