/* redirect the user to a failed login page */
function user_login_failed() {
	$referrer = $_SERVER['HTTP_REFERER'];
	if(!empty($referrer) && !strstr($referrer, "wp-login") && !strstr($referrer, "wp-admin") ) {
		$_SESSION["loginFailed"] = true;
		wp_redirect('http://replace_this_with_your_desired_url.com');
		die;
	}
}
add_action("wp_login_failed", 'user_login_failed', 0);