WordPress.org

Ready to get started?Download WordPress

Forums

[P2 TIP 002] add login/logout to frontpage (12 posts)

  1. cogmios
    Member
    Posted 5 years ago #

    If you want to add the loginbox to the frontpage, add this to the sidebar:

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

    Great job thanks!

  3. ehersman
    Member
    Posted 4 years ago #

    Very nice, thanks for adding this here. Works like a charm.

  4. steffenster
    Member
    Posted 4 years ago #

    Geat, thank you.

  5. João Leitão
    Member
    Posted 4 years ago #

    great!!! thanks!

  6. PapyRef
    Member
    Posted 4 years ago #

    Merci beaucoup

  7. Raize
    Member
    Posted 4 years ago #

    The SimpleLogin plugin also works really well.

  8. niska
    Member
    Posted 4 years ago #

    Is there a login/logout/forgot password/register * AJAX * wordpress plugin compatible with P2?

  9. peejay
    Member
    Posted 4 years ago #

    Using
    style="width: 150px"
    instead of
    size="20"
    makes the login form even prettier, as both textboxes get the same width.

  10. jus.systems
    Member
    Posted 4 years ago #

    Nice... thanks.

    You might change this line:

    admin

    to this:

    /wp-admin/">admin

  11. dlopeman
    Member
    Posted 4 years ago #

    I'm using iredlof-ajax-login-plugin successfully... although I will probably re-do it eventually... I've already taken a lot out of it... I just wanted the slide down thingie with the login stuff on it... plus I had to fix a tabindex problem with it... because i also use the register-plus plugin.

    Easy enough to search in the plugin page on WP... or google.

  12. juandrah
    Member
    Posted 4 years ago #

    @dlopeman :

    I'm using iredlof-ajax-login-plugin successfully too but cannot get either Register-Plus or Pie-Register to work with it. I get an error that there is a conflict with another plugin and the error goes away when I deactivate iredlof. there appears to be a conflict there. Please, how did you resolve it?

    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags