functions.php
/**
 * If log in fails, redirect to same page
 *
*/
If log in fails, redirect to same page
If log in fails redirect to same page
function my_front_end_login_fail( $username ) {
   $referrer = $_SERVER['HTTP_REFERER'];     
   if ( !empty($referrer) && !strstr($referrer,'wp-login') && !strstr($referrer,'wp-admin') ) {
      wp_redirect( $referrer . '?login=failed' );  
      exit;
   }
}
function my_front_end_login_fail ( $ username ) { $ referrer = $ _SERVER [ 'HTTP_REFERER' ] ; if ( ! empty ( $ referrer ) && ! strstr ( $ referrer , 'wp-login' ) && ! strstr ( $ referrer , 'wp-admin' ) ) { wp_redirect ( $ referrer . '?login=failed' ) ; exit ; } }
If log in fails, redirect to same page
If log in fails redirect to same page
// where did the post submission come from?
 // if there's a valid referrer, and it's not the default log-in screen // let's append some information (login=failed) to the URL for the theme to use