Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

http://redrokk.com/wordpress/wp-content/uploads/2012/07/blank_wordpress_login_form1.png

I want to add a custom link before the 'Lost your password?' link. I'm currently using a function that has some css to style my wordpress login page(I don't have a separate page for the login page). Any thoughts on how to do this?

share|improve this question

3 Answers 3

There are few login form hooks which could be useful to you:

login_form AND login_footer

You can find more information about them in the Codex: Customizing_the_Login_Form#Login_Hooks

share|improve this answer

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)

share|improve this answer

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;
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.