This topic has 5 replies, 3 voices, and was last updated 9 years, 1 months ago ago by shaharpan
Hello, I created a test account on my site to test out the login pages, and I noticed that when I hover over the SIGIN link on the homepage at the top right, and I enter my username and a wrong password, it takes me to this page, http://weheartsunglasses.com/wp-login.php where it tells them their password or username is incorrect.
How can I not make this happen and have my buyers actually redirect them to the http://weheartsunglasses.com/my-account/ where it will say that their password or username is incorrect like in this screen cap below
http://postimg.org/image/6woa0hi1n/
Thank you!
Hello,
In this case you may try to use this plugin https://wordpress.org/plugins/wp-admin-no-show/
Thank you.
Regards,
Eva Kemp.
Don’t you guys think this should be the default behavior for theme instead of new plugin.?
Hello @shaharpan,
Sorry for inconveniences.
We’ll try to fix it in future update.
Thank you.
Regards,
Eva Kemp.
Hi,
If anyone is looking for instant fix and don’t want to wait for future releases can use this code.
1) Add following code to functions.php
———————————————————————————
add_action( ‘wp_login_failed’, ‘my_front_end_login_fail’ ); // hook failed login
function my_front_end_login_fail( $username ) {
$referrer = $_SERVER[‘HTTP_REFERER’]; // where did the post submission come from?
// if there’s a valid referrer, and it’s not the default log-in screen
if ( !empty($referrer) && !strstr($referrer,’wp-login’) && !strstr($referrer,’wp-admin’) ) {
wp_redirect( ‘./my-account/?login=failed’ ); // let’s append some information (login=failed) to the URL for the theme to use
exit;
}
}
function fv_error_func( $atts ) {
extract( shortcode_atts( array(
‘type’ => ‘text’,
‘name’ => ”,
), $atts ) );
global $wp_query;
if( isset( $wp_query->query_vars[‘login’] ) && ($wp_query->query_vars[‘login’] == ‘failed’) )
return ‘
<div id=”login-error” style=”font-size: 16px; background-color: #FFEBE8;border:1px solid #C00;padding:5px;”>
Login failed: You have entered an incorrect Username or password, please try again or Use <b>Forgot Password?</b>
</div>’;
else
return ;
}
add_shortcode( ‘fv_error’, ‘fv_error_func’ );
function add_query_vars_filter( $vars ){
$vars[] = “login”;
return $vars;
}
add_filter( ‘query_vars’, ‘add_query_vars_filter’ );
———————————————————————
2) add shortcode “fv_error” on my-account page for on page error.
You must be logged in to reply to this topic.Log in/Sign up