Hide front-end from every logged out user and redirect them to the default login page
One way of doing this would be to add the code below to the top of your template file(s): <?php // redirect to login page if user is not logged in if ( !is_user_logged_in() ) : header(‘Location: /wp-login.php’); exit(); endif; ?> There are some subtleties around redirecting in PHP that you may want to consider, … Read more