How to change the redirect_to to redirect to the last viewed page?
Ok, what I would like to do is redirect users to the page they clicked the Login from. For example, if a user is in the comment of a post, I would like a successful login to bring him back to that particular post, so they can go on and post without having to browse back to the post he was about to comment.
I currently have my wp-login.php set to
$redirect_to = get_settings('siteurl') . '/index.php';
which is better for me then the default
$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
I mainly wish to have level 0 user to be affected.
I tried searching for how to use the referrer but since I don’t know PHP, I couldn’t find a way to do it.
- The topic ‘How to change the redirect_to to redirect to the last viewed page?’ is closed to new replies.