Redirect to login when on private page, and when logged in to specific page

from your code you need to change one for redirect user to specific page after login.

Your code :
$location = wp_login_url($_SERVER[“REQUEST_URI”]);

Change it as
$location = wp_login_url (i.e. http://www.testsite.com/start); // pass url of page where you want to redirect user after login

Hope this will help you.

Leave a Comment