Skip to content

Instantly share code, notes, and snippets.

@srinathweb
Created May 11, 2015 06:10
Show Gist options
  • Save srinathweb/33c83205b2d6458a3aad to your computer and use it in GitHub Desktop.
Save srinathweb/33c83205b2d6458a3aad to your computer and use it in GitHub Desktop.
front end login wordpress
<?php /* Template Name: Login Page AA */ ?>
<?php get_header(); ?>
<!-- section -->
<section class="aa_loginForm">
<?php global $user_login;
if(isset($_GET['login']) && $_GET['login'] == 'failed')
{
?>
<div class="aa_error">
<p>FAILED: Try again!</p>
</div>
<?php
}
if (is_user_logged_in()) {
echo '<div class="aa_logout"> Hello, <div class="aa_logout_user">', $user_login, '. You are already logged in.</div><a id="wp-submit" href="', wp_logout_url(), '" title="Logout">Logout</a></div>';
} else {
wp_login_form($args);
$args = array(
'echo' => true,
'redirect' => home_url('/wp-admin/'),
'form_id' => 'loginform',
'label_username' => __( 'Username' ),
'label_password' => __( 'Password' ),
'label_remember' => __( 'Remember Me' ),
'label_log_in' => __( 'Log In' ),
'id_username' => 'user_login',
'id_password' => 'user_pass',
'id_remember' => 'rememberme',
'id_submit' => 'wp-submit',
'remember' => true,
'value_username' => NULL,
'value_remember' => true
);
}
?>
</section>
<!-- /section -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment