hi!
i use php wp_login_form() to display a login form in my theme and set the redirect value to $_SERVER['REQUEST_URI'] . redirection works fine when the user types in the correct data, but on login errors i get stuck on the default login form.
so, anyone knows a way to redirect to the last page even on login errors?
i would appreciate any help!
is there really no solution?
xRommelx
Member
Posted 1 year ago #
do you show the login page link in the blog or website ???
if you answer is yes
you can use something like this
where u show the login page link
use something like this
wp-login.php?redirect=<?php echo $_SERVER['REQUEST_URI'] ?>;
now you have this in a var, so now just use this var, and if the login is correct you can use a header('location') and redirect to the last page or where the user come from