Display a different theme for not logged-in users

Try hooking on all these:

(But I guess you’d have to do it from a plugin, since doing it from theme functions.php might be too late).

E.g.:

/*
Plugin Name: test
Description: switchtest
Version: 0.1.0
*/

add_filter( 'template', 'yourthing_switch_theme' );
add_filter( 'option_template', 'yourthing_switch_theme' );
add_filter( 'option_stylesheet', 'yourthing_switch_theme' );
add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );

function yourthing_switch_theme( $theme )
{
   if ( is_user_logged_in() ) {
        return $theme;
   }
   else {
      return 'waiting';
   }
}

Leave a Comment