I created a website wide (wordpress) redirect for non-logged in users by adding the following code to my function.php file:
function admin_redirect() {
if ( !is_user_logged_in()) {
wp_redirect( home_url('/login') );
exit;
}
}
add_action('get_header', 'admin_redirect');
However there are a few pages, which should be accessible for non-logged in users. Any ideas how to solve the problem?
Thanks for your help!