It doesn't matter whether you're running a multi-author blog, or a blog where readers can register. Having a login form embedded in your sidebar will make your blog look a lot more professional and user friendly.
Here is what you can expect from this recipe. In the following screenshot, a login form has been added to the K2 theme sidebar.
To achieve this recipe, you'll have to edit the sidebar.php
file from your theme. The following hack works with WordPress 2.0 to 2.8.
Open the
sidebar.php
file for editing.Find the opening
<ul>
tag and paste the following code under it:<li> <?php global $user_ID, $user_identity, $user_level ?> <?php if ( $user_ID ) : ?> <h2><?php echo $user_identity ?></h2> <ul> <li><a href="<?php bloginfo('url') ?>/wp-login.php?action=logout&redirect_to=<?php echo urlencode($_SERVER['REQUEST_URI']) ...