Try hooking on all these:
(But I guess you’d have to do it from a plugin, since doing it from theme functions.php
might be too late).
E.g.:
/*
Plugin Name: test
Description: switchtest
Version: 0.1.0
*/
add_filter( 'template', 'yourthing_switch_theme' );
add_filter( 'option_template', 'yourthing_switch_theme' );
add_filter( 'option_stylesheet', 'yourthing_switch_theme' );
add_filter( 'pre_option_stylesheet', 'yourthing_switch_theme' );
function yourthing_switch_theme( $theme )
{
if ( is_user_logged_in() ) {
return $theme;
}
else {
return 'waiting';
}
}
Related Posts:
- get_template_part vs action hooks in themes
- Add custom classes to anchor in wp_nav_menu
- How to remove the Theme Customization Button from the dashboard and themes options page?
- What can I hook into after_setup_theme?
- Get password when user registers and save it sha1 into database
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- Passing variable in hooks and filter
- How to add theme support?
- Highlight “Show all” item in wp_list_categories
- Menu item added in wp_nav_menu_items filter is never highlighted
- Pass variable to hook. Its possible?
- Theme Development: Starter Content after hook
- How to change footer credit text in Twenty Twenty One theme with a hook?
- Modify available templates (in dropdown)
- Filter didn’t work on content class (hybrid_post_attributes)
- WordPress wp_get_current_user returning blank values until refresh
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- what is do_action(); in wordpress? [duplicate]
- Is there any filter or action hook to remove layout classes from appearing in my templates?
- The the_post_thumbnail without srcset?
- after_setup_theme always runs
- WordPress API Menu/Submenu Order
- What WP folder can I use to write files to?
- Why I can’t add a CSS style in this WordPress theme?
- wp_get_attachment_image_attributes not working for me
- register_sidebar ignores ‘id’ and ‘class’
- How to Auto Approve Comments on a Specific Page?
- What’s the difference between hooks, filters and actions? [duplicate]
- How do I get gallery thumbnail URL and change the default thumbnail size?
- Select menu on browser resize
- add_theme_support( ‘custom-header’ ) does not add option menu in dashboard
- Can I upload WordPress-react theme in Wp theme repository
- Upgrading a custom theme through the Dashboard
- WordPress nav_menu_css_class theme filter is not being called
- Get list of months with posts
- Cannot get full thumbnail size using the_post_thumbnail
- Version control for both Vagrant config and themes being developed [closed]
- Is there a way to activate different theme for specified users? [closed]
- how can I remove the sidebar from my wp homepage [closed]
- Does any theme support child theme?
- How do I save a wordpress theme’s files and install them on another site?
- “add_theme_support” for custom footer color?
- How to add infinite scroll?
- get_option in header.php not returning value from customizer
- Internal error 500 accessing Theme > Customize
- Show notice just below the search form on the themes page
- Default image size not working
- Change locale by detecting viewer’s browser language setting and let them choose prefered language after
- Why is it needed to enqueue parent stylesheet in child theme?
- Is there any WordPress theme for Self Storagae just like Spacer [closed]
- Customizer: save setting/control content to post/page
- WordPress Unite Theme: Footer isn’t sticking [closed]
- Is accessing theme and using customizer GPL distribution?
- How to enqueue javascript for WP Customize options sidebar?
- WordPress 500 Internal server error when activating custom theme [closed]
- Customize how a WordPress theme looks like in the Theme Selector
- How to set a page as homepage in stead of the newspages?
- Widget Option is Missing
- WordPress Theme Validator?
- If you were to start using a WordPress framework today, which one would you use? [closed]
- Template for landing pages
- Is it possible to have a theme that uses only one single page?
- underscores use of the article element on the page template
- Plugin does not work in custom theme
- html5-reset theme does not show the image [closed]
- Adding a gallery to my first theme
- What exactly is “wordpress theming”? [closed]
- Valid SQL query not returning results
- Change Image Sizes for Mobile Theme
- Recommended sidebar / content widths
- Converting a theme to a child theme in a network
- What is the difference between Twenty eleven & roots framework?
- Is there a list of default generated Gutenberg block CSS? Unable to align video blocks
- How to change listing type permlink?
- Adding popup support to the theme
- Calling a WP Plugin Function’s Variable in Theme Template [duplicate]
- Unpublished Pages Failing To Appear On Custom Path
- Override category archive page title (not the head title)
- How to make updatable custom WordPress theme?
- How can I access variables from theme in child theme? [closed]
- Local variable name in setup_postdata()
- Creating a Single Page Theme correctly
- Is it possible to echo a woocommerce prouct attribute discription?
- Child theme menu not appearing in Twenty Seventeen
- How do I remove header/page-title image in farvis theme? [closed]
- How to link post image to post link?
- On wordpress, how do i require specific dimensions from user uploads only
- WordPress Theme Developments – Start from another theme
- Slider should be display in home template [closed]
- Modify comments_popup_link output
- Can you create a custom page with content in the center already defined?
- How to migrate the menu from the site on my own theme in WordPress?
- RSS feed url showing page not found. How to solve it?
- How to convert that page to a wordpress template? [closed]
- Toolbox theme using printif statement – help needed understanding code block
- php file child theme directory not overriding parent theme php file [duplicate]
- Add rel to all images in a post
- How to Create a Multi Purpose Theme?
- Custom Single Page Portfolio Theme [closed]
- What is the point of using the front-page.php template? [closed]