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?
- Template for landing pages
- How to change the theme directory uri for localhost?
- Set a featured image as a replacement to the header image
- Unique design inside a specific category’s url
- How to rotate every letter in a title
- Is it possible to have a theme that uses only one single page?
- Custom theme: How to call archive-post.php for viewing blog posts
- Will my site get messed up when the wordpress theme updates if I edited the html code in the editor to change footer?
- underscores use of the article element on the page template
- Plugin does not work in custom theme
- How to Have a Pure HTML Sub Directory In WP Site
- How to correctly enqueue the parent and child theme stylesheets in the creation of a child theme? [duplicate]
- Create a child theme from multiple themes
- Theme not showing up
- html5-reset theme does not show the image [closed]
- Managing WordPress Theme
- Theming Using Bootstrap Glyphicons and WordPress Dashicons
- featured content: which area does this cover [closed]
- Change image size depending on page
- WordPress page/blog incorporated into static website
- How to disable thumbnail filter for a specific template part or image size?
- Theme Customizer not displaying saved values in wp_head (CSS)
- Random white space before doctype
- Adding a gallery to my first theme
- How to add menù section to my WordPress template?
- Are seven additional image sizes are too many?
- What are the critical theme files when building a custom theme?
- Having issue with WordPress wp_enqueue_style
- How can I use the WordPress Loop and Pagination in multiple instances but different scenarios throughout my site?
- CSS class on last post in loop ( custom query )
- Starting point for custom Themes [closed]
- How can I hard code my sidebar?
- What exactly is “wordpress theming”? [closed]
- Simple child theme modification but links are broken
- Theme Development -> Specific Homepage
- Making a WordPress theme based on twentyten
- Thesis -style Navigation
- registering a global template wordpress 6.0
- How can I wrap all blog posts image with
- theme style is applied on the dhasboard rather than the website
- Copying the theme style files and images to duplicate the website but with a difference
- Why still output /wp-content/themes/twentynineteen?
- Use a filter on menu items that have children
- I have WordPress setup on primary domain, how do I set it up on its subdomain using the same database?
- Which cache is kicking
- How to set Post meta-box defaults based on the choices made by user in Customizer?
- Theme Action to hook for one time only function [duplicate]
- Alignment Problem [closed]
- Difference between “comment_form_default_fields” AND “comment_form_fields”
- What $handle does WordPress use for a theme’s implicit style.css?
- searchform.php doesn’t work properly
- Issue when posting updates/changes to wordress
- Customizer: get_preview_url() inside customize_save_after hook
- Is There A WordPress Hook for Accessing Attachments for A Particular Page?
- Valid SQL query not returning results
- How to track a users last visited page?
- get_header action not working
- tiny_mce_before_init: ‘exact’ => true has no effect
- In a Gallery with limited image posts, how do I not limit images on single post?
- Shortcodes do not work in own template
- Adding Bootstrap to WordPress TwentySixteen Theme
- Unable to change the priority with ‘remove_action’ and ‘add_action’ in child theme
- LESS not working in WordPress [closed]
- pre_get_comments or the_content filter
- StoreFront WordPress theme: How can i create a new Home page with Custom design same as template [closed]
- How do I include a partial from a directory below a wordpress theme directory?
- Is there a way to switch to another theme?
- A post with a clear:both in its css destroy the theme design, and the sidebar is moved to the bottom
- New to WordPress – Read the Codex, Other Docs; Still Confused
- How add built-in textarea in theme development?
- Create theme for mobile phones and tablets only?
- Unwanted empty line at the beginning of document
- How to add custom page elements to the WYSIWYG editor?
- Why is my container argument not working for wp_nav_menu() [closed]
- Remove h1 from 2015 theme
- Never actually adding the action? Or do I have to call the action?
- WordPress pulling in random page themes
- best practices for updating wordpress theme
- Why I obtain different visualization when I run the website on my local machine and on remote server?
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- Some doubts about WordPress handle the horizontal main menu visualization