RUSSEL86

Login form Custom

Feb 2nd, 2016
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.63 KB | None | 0 0
  1. <?php global $user_ID, $user_identity; get_currentuserinfo(); if (!$user_ID) { ?>
  2.     <form method="post" action="<?php bloginfo('url') ?>/wp-login.php" class="login_form fix">
  3.         <div class="input-group-lg fix">
  4.             <label for="user_login">User Name:</label>
  5.             <input type="text" name="log" placeholder="User Name" id="user_login" value="<?php echo esc_attr(stripslashes($user_login)); ?>" class="form-control" />
  6.         </div>
  7.         <div class="input-group-lg fix">
  8.             <label for="login_pass">Password:</label>
  9.             <input type="password" name="pwd" placeholder="Password" id="login_pass" class="form-control" />
  10.         </div>
  11.         <div class="input-submit fix">
  12.             <?php do_action('login_form'); ?>
  13.             <input type="submit" name="user-submit" value="<?php _e('Login'); ?>" tabindex="14" class="user-submit btn-lg submit_btn" />
  14.             <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
  15.             <input type="hidden" name="user-cookie" value="1" />
  16.         </div>
  17.     </form>
  18.  
  19.     <?php } else { ?>
  20.  
  21.     <div class="sidebox">
  22.         <h3>Welcome, <?php echo $user_identity; ?></h3>
  23.         <div class="usericon">
  24.             <?php global $userdata; get_currentuserinfo(); echo get_avatar($userdata->ID, 60); ?>
  25.  
  26.         </div>
  27.         <div class="userinfo">
  28.             <p>You&rsquo;re logged in as: <strong><?php echo $user_identity; ?></strong></p>
  29.             <p>
  30.                 <a href="<?php echo wp_logout_url('index.php'); ?>">Log out</a> |
  31.                 <?php if (current_user_can('manage_options')) {
  32.                     echo '<a href="' . admin_url() . '">' . __('Admin') . '</a>'; } else {
  33.                     echo '<a href="' . admin_url() . 'profile.php">' . __('Profile') . '</a>'; } ?>
  34.  
  35.             </p>
  36.         </div>
  37.     </div>
  38. <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment