Redirect to referring page after logging in
I’m not sure I understand your setup, but here are few ideas: A) Display a login link with the redirect_to parameter set: You could add the following to your custom template pages: if( ! is_user_logged_in() ) { printf( ‘<a href=”https://wordpress.stackexchange.com/questions/169704/%s”>%s</a>’, wp_login_url( get_permalink() ), __( ‘You need to login to view this page!’ ) ); } … Read more