Styleswitcher or themeswitcher to allow user to switch back to standard view from mobile device

Wouldn’t it be enough to switch mobile/desktop via a $_SESSION variable, make the “switch to desktop link” include something like ?switchtodesktop=1 and have the header contain something like session_start(); if ($_GET[‘switchtodesktop’]) { $_SESSION[‘switchtodesktop’] = true; } $desktop = isset($_SESSION[‘switchtodesktop’]); […] if ($desktop) { // only desktop css without media queries } else { // default … Read more

Change site template from php

If I understand your question, you should use this inside your foreach: $argument_to_pass_to_switch_theme = $theme->get_stylesheet(); Just taking a look at the documentation: The function wp_get_themes()… “…returns an array of WP_Theme objects based on the argument.” This class WP_Theme has a method get_stylesheet(), which… “…returns a string with the directory name of the theme’s “stylesheet” files, … Read more

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 … Read more