Skip to content

Instantly share code, notes, and snippets.

@mdjwel
Created December 17, 2018 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdjwel/8dd094019514e05929e18a67d8ba8e9d to your computer and use it in GitHub Desktop.
Save mdjwel/8dd094019514e05929e18a67d8ba8e9d to your computer and use it in GitHub Desktop.
Custom user login form
<form name="loginform" id="loginform" action="<?php echo esc_url(home_url('/')); ?>wp-login.php" method="post" class="sign_form">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-12 form-group">
<input class="form-control" id="name_email" name="log" type="text"
placeholder="Username" onfocus="this.placeholder=''"
onblur="this.placeholder='Username'">
</div>
<div class="col-md-6 col-sm-6 col-xs-12 form-group">
<input class="form-control" type="password" name="pwd" id="pass"
placeholder="Password" onfocus="this.placeholder=''"
onblur="this.placeholder='Password'">
</div>
<div class="col-md-12 col-sm-12 col-xs-12 form-group">
<input type="checkbox" id="rememberme" value="forever">
<label for="rem"
class="remmember"><?php echo wp_kses_post($settings['remember_label']) ?></label>
<span class="float-right">
<a href="<?php echo esc_url(home_url('/')) . '/wp-login.php?action=lostpassword'; ?>"
class="forgot_pass_link">
<?php echo wp_kses_post($settings['forget_link_label']) ?>
</a>
</span>
</div>
<div class="col-md-12 col-sm-12 col-xs-12 form-group">
<input class="reg_button" type="submit" name="wp-submit" id="wp-submit"
value="<?php echo esc_attr($settings['btn_label']) ?>">
<input type="hidden" name="redirect_to"
value="<?php echo esc_url($settings['redirect_url']); ?>"/>
</div>
<?php if (!empty($settings['signup_link_text'])) : ?>
<div class="col-md-12 col-sm-12 col-xs-12 form-group">
<p class="text-center suggest">
<a href="<?php echo esc_url($settings['signup_link']) ?>"> <?php echo esc_html($settings['signup_link_text']) ?> </a>
</p>
</div>
<?php endif; ?>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment