[wp-hackers] Change theme per user / mobile

Robert Lusby nanogwp at gmail.com
Thu May 17 11:58:31 UTC 2012


Is there an action/filter to change the WordPress theme per user / onload?

Not switch_theme (I don't want to change it for everyone), just to 
change it for certain users, sometimes ...

I'm using the following two filters:
add_filter('template', 'mobile_theme_name');
add_filter('stylesheet', 'mobile_theme_name');

Which seem to update the StyleSheet path and Image paths to use the new 
theme, however WordPress is still loading the physical *.php (index.php, 
front-page.php, home.php etc) files from the *database* set themes 
folder, and not the new themes folder.

Obviously I'm missing a filter/action somewhere.

Thanks,
Rob.


More information about the wp-hackers mailing list