3 comments

  1. Well, you can add link after lost your password, but I don’t think you can add link before lost your password link unless you design your own login page.

    function hook_lost_your_password ( $text ) {
            if ($text == 'Lost your password?'){
                $text .= '<br /><a href="http://codebing.com">Visit Code Bing</a>';
            }
        return $text;
    }
    add_filter( 'gettext', 'hook_lost_your_password' );
    

    Source (Code Bing)

  2. Use the clean url filter to add the new link in an evil way.

    add_filter( 'clean_url', 'wpse_99251_add_anchor_to_login_form', 10, 2 );
    /**
     * Add an anchor (link) to the login form.
     */
    function wpse_99251_add_anchor_to_login_form( $good_protocol_url, $original_url ) {
    
        // Check to see if we are on the login page and escaping the "Lost Password?" url.
        if ( 'wp-login.php' == $GLOBALS['pagenow'] && $original_url == wp_lostpassword_url() ) {
    
            // If we get here, we are inside the href atribute of the lost password anchor.
            // So, the anchor we add starts in its middle.
            return sprintf(
                '%s" title="%s">%s</a> | <a href="%s',
                esc_url( 'https://my_link' ),           // Change to your link url.
                esc_attr( 'My Link Title' ),            // Change to your link title.
                'My Link Name',                         // change to your link name.
                $good_protocol_url
            );
        }
    
        return $good_protocol_url;
    }
    

Comments are closed.