If you’re using the handy wp_login_form()
function to create a custom log in page, you may have noticed that you don’t get the “Lost Password?” link. Doesn’t take much to add it back:
add_action( 'login_form_middle', 'add_lost_password_link' ); function add_lost_password_link() { return '<a href="/wp-login.php?action=lostpassword">Lost Password?</a>'; }
LIFESAVER!!
jeez… i swear i was so happy to find the codex to easily add this form, and i used php code widget to put it in my side bar… then i was like.. what about lost PW… finally days later i find your article.. Thank YOU!
Thanks… It Worked. 🙂
Thanks.
More correct use the code bellow:
add_action( 'login_form_middle', 'add_lost_password_link' );
function add_lost_password_link() {
return 'Lost Password?';
}
Thank you very much for this tip.
For a more dynamic path you can use:
add_action( ‘login_form_middle’, ‘add_lost_password_link’ );
function add_lost_password_link() {
return ‘Lost Password?‘;
}
A nice simple solution!
//return wp_lostpassword_url( get_permalink() );
An arguably better solution is:
add_action( 'login_form_bottom', 'add_lost_password_link' );
function add_lost_password_link() {
return 'Lost Password?';
//echo wp_lostpassword_url( get_permalink() );
}
Ok, this site doesn’t like the use of WP tag and html so here’s another try:
add_action( ‘login_form_bottom’, ‘add_lost_password_link’ );
function add_lost_password_link() {
return ‘Lost Password?‘;
}
add_action( ‘login_form_bottom’, ‘add_lost_password_link’ );
function add_lost_password_link() {
return ‘Lost Password?‘;
}
add_action( 'login_form_bottom', 'add_lost_password_link' );
function add_lost_password_link() {
return 'Lost Password?';
//echo wp_ lostpassword_ url( get_permalink() );
}
Здравствуйте! 123___Add the “Lost Password?” Link to wp_login_form() Output | trepmal*___123