[wp-hackers] Change theme per user / mobile

Dion Hulse (dd32) wordpress at dd32.id.au
Thu May 17 12:04:02 UTC 2012


If you're filtering it on the admin, you might end up with the
alternate value saved in the database (Or at least, that's all I can
think of).

The 3.4 Customizer switches themes on the fly, The first 5 filters in
this function( WP_Customize::start_previewing_theme()) are probably
needed in your case:
http://core.trac.wordpress.org/browser/trunk/wp-includes/class-wp-customize.php#L87

On 17 May 2012 21:58, Robert Lusby <nanogwp at gmail.com> wrote:
> 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.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers


More information about the wp-hackers mailing list