Created
January 29, 2019 00:45
-
-
Save jonlow/61e2ee4ff772e76e5635fbe86804dca1 to your computer and use it in GitHub Desktop.
Redirect all Wordpress templates to the login page
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
<?php | |
function hide_public_site( $template) | |
{ | |
wp_redirect( wp_login_url(), 301 ); | |
exit; | |
} | |
add_action('template_include', 'hide_public_site'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment