WordPress.org

Ready to get started?Download WordPress

Forums

Custom reset password form (2 posts)

  1. richlondon
    Member
    Posted 1 year ago #

    Hi,

    I am wanting to add a custom reset password form to the homepage of my site. It is actually in a hidden div that will reveal when the user hits the reset password button.
    I want all the error handling to take place in the lost password div, So display any messages below the rest my password button.
    This code below works in that it reset my password button does send the user a reset link.

    <div id="lostpassword" class="lostpassword span12 hero-search">
    				<form method="post" action="<?php echo site_url('wp-login.php?action=lostpassword', 'login_post') ?>" class="wp-user-form">
    <div class="span12">
    <h2>Enter your username or email and complete the captcha to reset your password.</h2>
    </div>
    <div class="span7">	
    
    <div class="username">
    <label for="user_login" class="hide"><?php _e('Username or Email'); ?>: </label>
    <input type="text" class="search-query" name="user_login" value="" size="20" id="user_login" tabindex="1001" placeholder="Username or email address" />
    </div>
    </div>
    <div class="span4 captcha ">
    <?php if( function_exists( 'cptch_display_captcha_custom' ) ) { echo "<input type='hidden' name='cntctfrm_contact_action' value='true' />"; echo cptch_display_captcha_custom(); } ?><br/>
    <?php if( function_exists( 'cptch_check_custom_form' ) && cptch_check_custom_form() !== true )?>
    </div>
    <div class="span4 offset4">
    <?php do_action('login_form', 'resetpass'); ?>
    <input type="submit" id="searchsubmit" name="user-submit " value="<?php _e('Reset my password'); ?>" class="user-submit btn" tabindex="1002" />
    <?php $reset = $_GET['reset']; if($reset == true) { echo '<p>A message will be sent to your email address.</p>'; } ?>
    <input type="hidden" name="redirect_to" value="/" />
    <input type="hidden" name="user-cookie" value="1" />
    
    </div>
    </form>
    </div>

    However how can I make it so that the user never sees the default wordpress form?
    Ideally I want the code to all be on one place, as the theme I am using, uses complex includes, so the actually page is made up of seversl php files.

    Thanks

  2. SSchat
    Member
    Posted 9 months ago #

    point it to a custom 'reset' page?

    create it via a new page-template maybe

Topic Closed

This topic has been closed to new replies.

About this Topic