Login Link Hover Wrong Redirect - by klxtl

This topic has 5 replies, 3 voices, and was last updated 9 years, 1 months ago ago by shaharpan

  • Avatar: klxtl
    klxtl
    Participant
    January 22, 2015 at 09:29

    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!

    Please, contact administrator
    for this information.
    4 Answers
    Avatar: Eva
    Eva Kemp
    Support staff
    January 22, 2015 at 09:50

    Hello,

    In this case you may try to use this plugin https://wordpress.org/plugins/wp-admin-no-show/

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: shaharpan
    shaharpan
    Participant
    March 4, 2015 at 15:06

    Don’t you guys think this should be the default behavior for theme instead of new plugin.?

    Avatar: Eva
    Eva Kemp
    Support staff
    March 4, 2015 at 17:35

    Hello @shaharpan,

    Sorry for inconveniences.
    We’ll try to fix it in future update.

    Thank you.
    Regards,
    Eva Kemp.

    Avatar: shaharpan
    shaharpan
    Participant
    March 4, 2015 at 22:18

    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.

  • Viewing 5 results - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.