Can’t switch theme after activation

It seems that you are executing updateTheme() in every page load. To execute tasks only on activation you should hooke the updateTheme() function to the register_activation_hook action hook: register_activation_hook( __FILE__, ‘activation_callback’ ); function activation_callback() { //The code inside this function is executed only on plugin activation $theme=”twentyeleven”; //SET the value of $theme to whatever you … Read more

WP 3.3 RC1 new switch_theme() method foobars sidebars

Likely your code is somehow breaking on the new widget handling methods, which save old widget layouts when theme switches occur. http://wordpress.org/news/2011/11/wherefore-art-thou-widgets/ Most likely, you’ll have to switch themes before adjusting the widgets in it, since widgets don’t survive theme switches anymore, or at least, will be restored from older settings after a theme switch.