Welcome to WebmasterWorld Guest from 54.226.147.190

Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Wordpress Login validation on theme

Wordpress Login validation on theme

     

whyyi

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

5+ Year Member



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:16 pm on May 5, 2011 (gmt 0)

5+ Year Member



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

11:03 pm on May 15, 2011 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Would these do the job:

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

whyyi

6:04 pm on Jun 1, 2011 (gmt 0)

5+ Year Member



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

7:32 pm on Jun 1, 2011 (gmt 0)

WebmasterWorld Senior Member lorax is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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

4:41 pm on Jun 2, 2011 (gmt 0)

5+ Year Member



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.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month