I want to make my wordpress site hidden or restricted from guest user. Only the the registered member will see my pages, if they are not registered then they will be redirected in login page/ registration page.
When i am tried to use some plugin to do that then all of my pages restricted and there had option to exclude only one page (login page). But i guest cant register there. Because all of the page restricted excluding loging page. SO thats a problem.
Now i think i can use custom code something like that
<?php
if ( is_user_logged_in() ) {
echo 'Welcome, registered user!';} else { echo 'You have no rights to access this page. Please <a href=\"#\">log in</a> or a href=\"#\">register</a> now to access that page';
}
?>
But how can i set a function , "If logged in then full page will open other wise show a text"