I render login form on my header template using this code:
<?php wp_login_form($args); ?>
When I pass proper credentials, it redirect me to homapage and all seems to be fine, but when I put wrong login or pass, it redirect me to the folowing url:
http://localhost/wordpress/wp-login.php
So the question is how I can output errors on the same page , and prevent redirection to the wp-login
? I try to find solution but didnt have any results. Thanks!
Add this to your functions.php :
This code redirects to the same page as the user tries to log in from.
Change
$referrer
for another page.Hope it will works for you.