WordPress.org

Ready to get started?Download WordPress

Forums

Login-forms in sidebar? (4 posts)

  1. Testrup
    Member
    Posted 7 years ago #

    Hi there,

    So - I want to put two login-forms (input fields) in my sidebar instead of just have a "Login"-link at the frontpage. A "Username" and a "Password"-field.

    I just can't get this thing to work.

    Does anyone know if there is some kind of plugin to fix my situation? Or just a code-snippet to insert in sidebar.php ?

    Thank you so much in advance.

    Best regards,

    Testrup

  2. sfong15
    Member
    Posted 7 years ago #

    This post may answer your question. A widgetized version is also available now.

  3. pizdin_dim
    Member
    Posted 7 years ago #

    This chunk of code should also work. Put it in your sidebar somewhere:

    <?php if (isset($user_level) && $user_level > 0): ?>
    <div>
    <ul>
    <li><a href="<?php bloginfo('wpurl'); ?>/admin/" title="admin">Site Admin</a></li>
    <li><a href="<?php bloginfo('wpurl'); ?>/wp-login.php?action=logout&amp;redirect_to=<?php echo $_SERVER['REQUEST_URI']; ?>" title="logout">Logout (<?php echo $user_nickname; ?>)</a></li>
    </ul>
    </div>
    <?php else: ?>
    <form name="loginform" id="loginform" action="<?php echo get_settings('siteurl'); ?>/wp-login.php" method="post">
    <label><?php _e('Login') ?>:<input type="text" name="log" id="log" value="" size="20" tabindex="7" /></label>
    <label><?php _e('Password') ?>: <input type="password" name="pwd" id="pwd" value="" size="20" tabindex="8" /></label>
    <input type="submit" name="submit" value="<?php _e('Login'); ?> &raquo;" tabindex="9" style="margin-top: 0.5em" />
    <?php wp_register(); ?>
    <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/>
    </form>
    <?php endif; ?>
  4. www.onlinecasinoselite.com
    Member
    Posted 7 years ago #

    Why do you start your post with "So"? It isn't necessary. We weren't in the middle of a conversation where you were explaining something that came before.

    Dude.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.