Disclaimer I apologize that this issue is so closely related to another. I would have commented on the original post, but I don't have enough reputation, and I don't have enough programming experience to grind reputation by answering questions.
The Question I've used the following code to force users to log into my wordpress site:
// Force user to login on welcome
function forceLogin() {
global $post;
if ( ( is_single() || is_front_page() || is_page() || is_archive() || is_post() )
&& !is_page('login') && !is_user_logged_in()){
auth_redirect();
}
}
I then included that function in my header.php file for my child theme. So far everything works great.
The problem I have is that when a user with the "subscriber" role is logged in and tries to access my posts page, which is also set as my static home page, they get redirected to the "lost password" page with a "invalid key" error (ie: www.domain.com/lostpassword/?error=invalidkey).
It should be noted that I'm using the Theme My Login plugin (http://wordpress.org/plugins/theme-my-login/) to style my login page.
Thank you so much, and be gentle.
Original Post Wordpress force user to login before view any site content