How To Display Login Form In Sidebar[wordpress]

By

August 8, 2012Wordpress2 Comments

3 Flares Twitter 0 Facebook 2 Google+ 1 Pin It Share 0 LinkedIn 0 3 Flares ×

How To Display Login Form In Sidebar[wordpress]

Displaying sidebar login in wordpress is real difficult to other wordpress users. many of my clients asked me for displaying the sidebar login form. So in this tutorial i will show you how to display login in your sidebar.

1. Copy the following code in your sidebar. That’s it!!

	<li>
		<?php global $user_ID, $user_identity, $user_level ?>
		<?php if ( $user_ID ) : ?>
		<h2>Control panel</h2>
		<ul>
			<li>Identified as <strong><?php echo $user_identity ?></strong>.
			<ul>
				<li><a href="<?php bloginfo('url') ?>/wp-admin/">Dashboard</a></li>
 
				<?php if ( $user_level >= 1 ) : ?>
				<li><a href="<?php bloginfo('url') ?>/wp-admin/post-new.php">Write an article</a></li>
				<?php endif // $user_level >= 1 ?>
 
				<li><a href="<?php bloginfo('url') ?>/wp-admin/profile.php">Profile and personal options</a></li>
				<li><a href="<?php bloginfo('url') ?>/wp-login.php?action=logout&amp;redirect_to=<?php echo urlencode($_SERVER['REQUEST_URI']) ?>">Exit</a></li>
			</ul>
			</li>
		</ul>
 
		<?php elseif ( get_option('users_can_register') ) : ?>
 
		<h2>Identification</h2>
		<ul>
			<li>
			<form action="<?php bloginfo('url') ?>/wp-login.php" method="post">
				<p>
				<label for="log"><input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="22" /> User</label><br />
				<label for="pwd"><input type="password" name="pwd" id="pwd" size="22" /> Password</label><br />
				<input type="submit" name="submit" value="Send" class="button" />
				<label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label><br />
				</p>
				<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>"/>
			</form>
			</li>
 
			<li><a href="<?php bloginfo('url') ?>/wp-register.php">Register</a></li>
			<li><a href="<?php bloginfo('url') ?>/wp-login.php?action=lostpassword">Recover password</a></li>
		</ul>
 
		<?php endif // get_option('users_can_register') ?>
 
	</li>

2. Place the following in sidebar.

Source: WPdesigner

Get Free Updates in your Inbox
Follow us on:
facebook twitter gplus pinterest rss
Tags:
2 Responses to “How To Display Login Form In Sidebar[wordpress]”
  1. Your blog is awesome. Thank you so much for providing plenty of useful information. I will bookmark your blog siteand will be without doubt coming back. Once again, I appreciate all your work and also providing a lot great concepts to the audience.

  2. Good day! I could have sworn I’ve been to this site before but after looking at a few of the articles I realized it’s new to me.
    Nonetheless, I’m certainly pleased I came across it and I’ll
    be book-marking it and checking back regularly!

Leave a Reply

3 Flares Twitter 0 Facebook 2 Google+ 1 Pin It Share 0 LinkedIn 0 3 Flares ×