Controller functionality – if user is not logged in send them to specific page (not wp_login)
The reason why you are getting a not redirecting properly message is because you are creating an endless loop of redirects. They get redirected to /public but because they are not logged in they get redirected again and again and again… Try this code instead: if( ! is_user_logged_in() && ! is_page(“public”) ) { wp_redirect( site_url(“/public”) … Read more