Posted by KaiseRCrazY on 10th September 2009
A Simple Login Form For Your Sidebar!
If you want to add a new login form to your Sidebar or Page tepmlate you can use this simple code :) This will make a way for quick login. Lets Begin..
Here is the code;
<?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 }?>
That’s All. Have a nice day!
The Original Post: Add a Login Form to Your WordPress Theme
This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.
-
Categories
Colored Tags
feed posts Functions RSS author content comments.php header.php title mysql code robots site plugin index.php theme categories Facebook blog spiders css function style.css hide javascript template category Wordpress functions.php article post Widget no-index Google comment Yahoo else image time funcitons sidebar single.php comments Loop ifRecent Comments
Archives
Blogroll
Google Ads















Made by Symmetric Web
Distributed by Smashing Magazine
No comments yet!