I just inserted a login form into my sidebar, tested it and it worked. When a user types in their username, then password, they are directed to my home page.
All I did was copy and pasted the form section from wp_login.php which is found in your root directory into my sidebar where I wanted the user name and password form elements to appear…
<?php if ( $error ) echo "<div id='login_error'>$error</div>";?>
<form name="loginform" id="loginform" action="wp-login.php" method="post">
<label><?php _e('Username') ?><input type="text" name="log" id="log" value="" size="20" tabindex="1" /></label>
<label><?php _e('Password') ?><input type="password" name="pwd" id="pwd" value="" size="20" tabindex="2" /></label>
<p class=”submit”>
<input type="submit" name="submit" id="submitbutton" value="<?php _e('Login'); ?> »" tabindex="3" />
<input type="hidden" name="redirect_to" value="<?php echo $redirect_to; ?>" /></p>
</form>
I tweaked the css to style the login section and there you go. One happy camper…
Oh, I also removed the standard
<?php wp_loginout() ?>
element from my sidebar, cos I now have a fancier login section, and then I went to my admin/dashboard looked up under “source” in my browser for the (logout: (admin)) html code part and copy and pasted that too into the sidebar using
- tags, so when a user wants to log out she can.
Now when the page is display I have a login box without the added duplicate login link that was there by default.
Kate