• 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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter skarck

    (@skarck)

    is there really no solution?

    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘redirect on login error’ is closed to new replies.