homepage Welcome to WebmasterWorld Guest from 54.197.110.151
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / WordPress
Forum Library, Charter, Moderators: lorax & rogerd

WordPress Forum

    
Wordpress Login validation on theme
Wordpress Login validation on theme
whyyi

5+ Year Member



 
Msg#: 4314137 posted 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!

 

whyyi

5+ Year Member



 
Msg#: 4314137 posted 5:16 pm on May 5, 2011 (gmt 0)

Does anybody happen to know on this one or maybe a better solution or different solution.

I'm pretty desperate here so anything would help :)

ergophobe

WebmasterWorld Administrator ergophobe us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4314137 posted 11:03 pm on May 15, 2011 (gmt 0)

Would these do the job:

[wordpress.org...]
[wordpress.org...]

whyyi

5+ Year Member



 
Msg#: 4314137 posted 6:04 pm on Jun 1, 2011 (gmt 0)

Hi Ergophobe,

Thanks for the suggestion but it actually kind of does the same thing were if you enter a wrong username and password it shoots you to the wordpress backend and gives you an error. I'm looking to keep you on the same page but give you an error.

Thanks :)

lorax

WebmasterWorld Administrator lorax us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4314137 posted 7:32 pm on Jun 1, 2011 (gmt 0)

I think you'll need to write something to do the check yourself. OR switch to a theme built to accommodate a user community like BuddyPress.

whyyi

5+ Year Member



 
Msg#: 4314137 posted 4:41 pm on Jun 2, 2011 (gmt 0)

Thanks lorax! I was hoping it wouldn't have to come to that but I think your right can't seem to find another way to do it.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / WordPress
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved