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 for is_user_logged_in()
if you just want to differentiate between non-logged in and logged in users. Then you have the switch_theme()
function. Just wrap it up in a plugin and add a function that you hook into plugins_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 is after_setup_theme
.
Related Posts:
- Switch Theme Through Options Panel
- Switch to other theme at URL
- Specific theme for non logged in users
- change template with button
- What are all the available parameters for query_posts?
- Link to specific Customizer section
- How do I change the header image height in Twenty Seventeen?
- Is it OK to remove theme credits from footer? [duplicate]
- How to create a new theme from scratch?
- What theme is good for posting code? [closed]
- Difference between stylesheet_directory and template_directory
- How to see files in directories in “Edit Themes” screen
- WordPress generating 404 on .mp4 file in theme folder
- Why are my widgets not saving when being added to a sidebar?
- Building useful features into your theme
- How to remove “Proudly powered by WordPress” in Twenty Sixteen (2016) theme?
- How can I check for malware in a Theme? [closed]
- Editing theme files and access to the Code pages only to super-admin?
- How to put a banner ad between post 1 and post 2 on homepage only
- How to reverse the pagination numbers of an archive?
- In which directory do I find a specific HTML code of my wordpress page? Some of it seems to be missing after checking all pages [closed]
- Why do Trackbacks/Pingbacks not appear below my posts/pages?
- Extra themes – ok or bad?
- WordPress AJAX in header.php
- Theme Customizer – How to create a sub panel
- Setting a static home page and blog page without using the settings
- Can’t Install Child Theme “The parent theme is missing. Please install the “Default” parent theme.”
- Use a different template/theme if mobile only on home page
- Can i have a single wordpress site to have two themes ( one for pc other for mobiles)
- Translated my theme (translation not showing up)
- How to use get_page_by_title() with qTranslate?
- Changing $before_widget for certain widgets
- wp theme.. Could not create directory
- Multi-level page hierarchy
- How to conditionally display widgetized areas in theme customizer?
- How prevent someone from opening my theme directory
- loss of theme options while site deployment in production
- How to install WordPress theme and configure it? [closed]
- How do I get rid of or change the footer in my child theme?
- How can I make some themes usable only by admins?
- Categories gone after changing theme / demos [closed]
- Angular integration with homepage
- Own Theme Customizer displays error message when saving, saving still works
- 1 Database for multiple WordPress themes
- Page has a parent and $post->post_parent returns 0
- How to create different navigation for registered users in WooThemes Canvas?
- Selected template is not respected for home page in WordPress
- How to make Additional css changes global all across the web pages on WordPress website?
- WordPress without a theme – help!
- How to restore file or theme?
- A /proc folder in wp-content?
- How to install themes with the demo content?
- Jetpack CSS .screen-reader-text breaks mobile menu [closed]
- Error when using ‘continue reading’
- How to update theme to specific version
- Child theme’s stylesheet cannot load [closed]
- can’t see aditional themes in control panel
- Configure new installed WordPress in live server
- What’s the default order used by WordPress to load CSS files?
- Where does WordPress get the theme name from to check for updates?
- Hi everybody, I have a problem of search box
- How can I remove all traces of a theme?
- Changing an image in header.php
- Updating WordPress Theme Files
- A thin line between native wordpress bahaviour and 3rd party themes
- Display Pointer only once?
- Multiple sub directories for theme template pages
- How to get the theme directory URI?
- From where wp ecommerce is loading plugin theme files?
- Making first post wider than other posts on home page(default)
- My blog suddenly can’t find my stylesheet?
- Twenty Ten Theme: Replace the Logo by a picture without moving the code
- How to fix Scrape key check failed on WordPress VPS?
- Removing a widget via theme editor
- How do I get the featured image to sit below the header in the twenty nineteen theme?
- How to use my .mo file in the Divi child theme instead of file in a parent /builder directory?
- How to fix Gutenberg with SiteOrigin page builder deleting content when editing
- How do I remove search bar that isn’t a widget?
- TwentyFourteen Theme : Changing grid layout
- Edit a template while still keeping a Landing Page on the main address
- How to allow users to switch to the child theme from front end without plugin?
- Change whole theme depending on resolution
- post_prev & post_next within same category
- Costum Theme template directoy url problem
- How to remove the option data of a theme when that theme is removed?
- How to find out which template the HTML content comes from?
- Resetting Themes Folder to Default
- What is the general cut-off date for reviewed themes in the WordPress.org repository?
- Convert theme to be based on Bootstrap?
- Include root files into header files
- Commenting in CSS (//) equals “none”? [closed]
- Static posts page is not working
- Cannot use some themes within Managed WordPress of Go Daddy [closed]
- How to track your theme usage on the internet?
- How to add Company Logo to Chosen Theme
- What security risk is not having “default” theme?
- My theme is not translated
- Wrong theme being activated
- I am unable to remove “© 2022 My Blog | PopularFX Theme ” from footer [closed]
- Workaround AJAX calling without directly calling WordPress backend (Admin dashboard) because it is restricted to the end user (the public)