Posted By

Daidaros on 12/20/10


Tagged

wordpress


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

joeltgraphics
anhonestboy
tsra1983


Login Form for WordPress anywhere


 / Published in: PHP
 

URL: http://www.wprecipes.com/add-a-login-form-on-your-wordpress-theme

Para colocar el login de WordPress en cualquier página.

  1. <?php if (!(current_user_can('level_0'))){ ?>
  2. <h2>Login</h2>
  3. <form action="<?php echo get_option('home'); ?>/wp-login.php" method="post">
  4. <input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="20" />
  5. <input type="password" name="pwd" id="pwd" size="20" />
  6. <input type="submit" name="submit" value="Send" class="button" />
  7. <p>
  8. <label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label>
  9. <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
  10. </p>
  11. </form>
  12. <a href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Recover password</a>
  13. <?php } else { ?>
  14. <h2>Logout</h2>
  15. <a href="<?php echo wp_logout_url(urlencode($_SERVER['REQUEST_URI'])); ?>">logout</a><br />
  16. <a href="http://XXX/wp-admin/">admin</a>
  17. <?php }?>

Report this snippet  

You need to login to post a comment.