Page is a not externally linkable
- Code, Content, and Presentation
-- WordPress
---- Wordpress Login validation on theme


whyyi - 7:21 pm on May 2, 2011 (gmt 0)


Bit of a newbie here so bear with me.

I was able to find some code that almost did what I want which is essentially adding the wordpress login to my theme but the problem is that if there isn't a valid user it redirects to the wordpress back end. Is there a user_verify function or something out there that will simply display a message on the page?

Here's the code I currently have:



<?php if (!(current_user_can('level_0'))){ ?>


<div id="user_login">
<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" />
<label class="username" for="log">Username</label>
<label class="password" for="password">Password</label>
<input type="submit" name="submit" value="Send" class="button" />
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
</form>

<a class="register_now" href="?page_id=77">Register Now</a>
<img class="form_bottom" src="<?php bloginfo('template_directory'); ?>/library/images/form_bottom.png" />
</div>

<?php } ?>



Any help is greatly appreciated!


Thread source:: http://www.webmasterworld.com/wordpress/4314137.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com