I plan to use the member plugin by Justin Tadlock
I wish to know if how could I, on the front side, auto switch to a theme according to a role status.. for example authors would have the site presented using theme 1 while editor would have the site presenter using theme 2
I would rather have 2 different theme rather than conditionals within one theme structure
Thank you in advance
There’s
current_user_can( 'CAPABILITY' );
(see @Codex Users & Roles to find the appropriate cap for your targeted role), that you can use to determin what theme you want to display. You can also check foris_user_logged_in()
if you just want to differentiate between non-logged in and logged in users. Then you have theswitch_theme()
function. Just wrap it up in a plugin and add a function that you hook intoplugins_loaded
or something similar (not sure when the user info is ready). Then switch depending on the role. Sidenote: You can’t do that from a themes functions.php file, as the first available hook isafter_setup_theme
.