In order to dynamically switch a theme in functions file (e.g. when wanting a different theme for a different domain, but same website), you use the following:
add_filter('template', 'my_switch_theme_for_domain');
add_filter('option_template', 'my_switch_theme_for_domain');
add_filter('option_stylesheet', 'my_switch_theme_for_domain');
function my_switch_theme_for_domain()
{
return 'my-child-theme';
}
This does not seem to work when wanting to call a child theme. I get a white/blank page when calling a child theme, I have tried a few.
Is there some other code to switch to a child theme?