• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Add Lost Password Link

This code enables you to add a link to create a new password via email.

lost-password

Once you submit the form, you’ll be redirected back to the URL where you clicked the link. You will also recieve a email with link to reset your password.

The link works in exactly the same way as the link added below the login form.

You can also determine which URL the form redirects to after submission.

The following code snippets use wp lostpassword url

Themes Template File

If you’re using a theme like Twenty Sixteen, you can add trhe folloowing code to any template file like the header.php or footer.php.

<span class="lost-password">
<a href="<?php echo wp_lostpassword_url( get_permalink() ); ?>" title="Lost Password">Lost your password?</a>
</span><!-- .lost-password -->

Themes With Custom Hooks

Themes with custom hooks like Genesis, enable you to hook the link in from your functions file.

add_action( 'genesis_header_right', 'lost_password_link' );
function lost_password_link() {
printf( '<a class="button" href="%s" title="Lost Password">Lost Password</a>', wp_lostpassword_url( get_permalink() ) );
}

Related Code

  • Add Login Logout Link To Any Nav Menu

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.