Reputation: 3
I am looking to redirect users who are not logged in on any page of my WordPress website to a /welcome page which will have a sign up form on. This is pretty essential as it is a small social networking site.
I am also trying to do this without having any redirect loop issues so my users can easily get to the /welcome page without any hassle.
Upvotes: 0
Views: 1102
Reputation: 1012
Put this in your header.php
file
if( !is_user_logged_in() && !is_page( 'welcome' ) ) {
wp_redirect( bloginfo( 'url' ) . '/welcome' );
exit;
}
Hope that helps
Regards
Dan
Upvotes: 1