I've been browsing some of the other questions and I haven't been able to find a solution. There was a great solution to part of my problem that I'm basing this code on. I need to detect if on mobile, and display the mobile theme with one exception. If a user is on mobile and on page ID 145 the normal theme needs to be used. This is the code I have that works, except does not display the normal theme on that specific page on mobile. I've tried some variations with no luck. Thanks for looking.
add_filter('template', 'change_theme');
add_filter('option_template', 'change_theme');
add_filter('option_stylesheet', 'change_theme');
function change_theme($theme) {
if ( wp_is_mobile() ) {
$theme = 'SelectThemeMobile';
}
elseif ( is_page( 145 ) && wp_is_mobile() ) {
$theme = 'SelectThemeOne';
}
return $theme;
}
if(!is_page(145) && wp_is_mobile()) { // use other template }