Created
October 23, 2025 09:03
-
-
Save wurwal/97340f85232485c24b1c343f69ed82d5 to your computer and use it in GitHub Desktop.
WP holding page redirector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function redirect_all_to_holding() { | |
| if ( ! is_user_logged_in() && ! is_page('coming-soon') ) { | |
| wp_redirect( home_url('/coming-soon/') ); | |
| exit; | |
| } | |
| } | |
| add_action( 'template_redirect', 'redirect_all_to_holding' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment