Title: Remember user choice
Last modified: August 21, 2016

---

# Remember user choice

 *  [richtelford](https://wordpress.org/support/users/richtelford/)
 * (@richtelford)
 * [13 years ago](https://wordpress.org/support/topic/remember-user-choice/)
 * If a user clicks “Switch to Desktop Version” it takes the user to the site homepage
   using the desktop theme which I guess is correct. But then when the user clicks
   another link it reverts back to the mobile theme. Is it possible to remember 
   the chosen theme so the user can navigate around on the desktop site on a mobile
   device???
 * [http://wordpress.org/extend/plugins/any-mobile-theme-switcher/](http://wordpress.org/extend/plugins/any-mobile-theme-switcher/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  [Abel Rogers](https://wordpress.org/support/users/abelito/)
 * (@abelito)
 * [13 years ago](https://wordpress.org/support/topic/remember-user-choice/#post-3738695)
 * Having same issue.
 * this used to work until i upgraded to 1.2
 * Looking to revert back to v1.1
 *  Thread Starter [richtelford](https://wordpress.org/support/users/richtelford/)
 * (@richtelford)
 * [13 years ago](https://wordpress.org/support/topic/remember-user-choice/#post-3738696)
 * I made a few modifications to my local version of the plugin. The main change
   I made was to use $_COOKIE instead of $_SESSION to store user choice. It works
   very well.
 *  [Abel Rogers](https://wordpress.org/support/users/abelito/)
 * (@abelito)
 * [13 years ago](https://wordpress.org/support/topic/remember-user-choice/#post-3738697)
 * Reverted back to v1.1 and all works fine now, but using $_COOKIE instead of $
   _SESSION makes far more sense to me too.
 * Could you paste what changes you made and will apply myself.
 * Presume majority of changes are after line 91 of any-mobile-theme-switcher.php??
 * thanks
 *  Thread Starter [richtelford](https://wordpress.org/support/users/richtelford/)
 * (@richtelford)
 * [13 years ago](https://wordpress.org/support/topic/remember-user-choice/#post-3738699)
 * Yes that’s correct. I replaced that section from 91 down with:
 *     ```
       //Force Theme Display request from visitor.
       if (@$_GET['am_force_theme_layout']){
       	//$_COOKIE['am_force_theme_layout'] 	=	$_GET['am_force_theme_layout'];
       	setcookie("am_force_theme_layout", $_GET['am_force_theme_layout']);
       	header("Location: /");
       	exit;
       }
   
       if (isset($_COOKIE['am_force_theme_layout'])){ //IF USER FORCE FOR THE THEME
       	if ($_COOKIE['am_force_theme_layout'] == 'mobile'){ // IF FORCED THEME IS MOBILE
       		$mobile_browser = get_option('iphone_theme');
       		add_filter('stylesheet', 'loadMobileStyle');
       		add_filter('template', 'loadMobileTheme');
       		$shown_theme = 'mobile';
       	}
       } else { // NORMAL THEME [PLUGIN DEFAULT]
       	if (!empty($mobile_browser)){
       		add_filter('stylesheet', 'loadMobileStyle');
       		add_filter('template', 'loadMobileTheme');
       		$shown_theme = 'mobile';
       	}
       }
       ```
   
 *  [Abel Rogers](https://wordpress.org/support/users/abelito/)
 * (@abelito)
 * [13 years ago](https://wordpress.org/support/topic/remember-user-choice/#post-3738738)
 * As simple as that. Yes, looking at it, that is that is required really.
 * Thanks

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Remember user choice’ is closed to new replies.

 * ![](https://ps.w.org/any-mobile-theme-switcher/assets/icon-128x128.png?rev=1109204)
 * [Any Mobile Theme Switcher](https://wordpress.org/plugins/any-mobile-theme-switcher/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/any-mobile-theme-switcher/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/any-mobile-theme-switcher/)
 * [Active Topics](https://wordpress.org/support/plugin/any-mobile-theme-switcher/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/any-mobile-theme-switcher/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/any-mobile-theme-switcher/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Abel Rogers](https://wordpress.org/support/users/abelito/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/remember-user-choice/#post-3738738)
 * Status: not resolved