i am building a new theme, and one of the sections on the front page is login / registration area
i am trying to accomplish this without using a plugin or a sidebar
i looked at this site
http://stilldesigning.com/2008/05/01/custom-login-page-for-wordpress/
but its close but not exactly what i am looking for
here is a link to a site that has login and registration on one page
this is what i am trying to mimic
https://www.crunchyroll.com/login
any ideas?
i put this in the index code
<div class="index_main_login">
<?php include (ABSPATH . '/wp-login.php'); ?>
</div>
but his just loads the wp-login.php page
how can i make my own login page and load that instead
and have the login and registration area together on one page
sorry i have to bump this, any ideas guys?
sorry for bumb, but lately no one likes my questions :(
i guess i can bump this, is been 1 day :)
please anyone
brianbrey
Member
Posted 1 year ago #
this should work for you..
<form name="loginform" id="loginform" action="<?php get_option('home') ?>/wp-login.php" method="post">
<label><?php _e('Username') ?>
<input type="text" name="log" id="user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" /></label>
<label><?php _e('Password') ?>
<input type="password" name="pwd" id="user_pass" class="input" value="" /></label>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e('Remember Me'); ?></label>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
<input type="hidden" name="redirect_to" value="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ?>" />
<input type="hidden" name="testcookie" value="1" />
</form>
brianbrey
Member
Posted 1 year ago #
You can either change the redirect after login with the wp-login.php. (located in the root folder. or use the entire code below.. After logging in, it will keep you on the same page, except replace the login form with the text or info put in.. i.e. a logout button, etc
<div id="userbar">
<?php if ( is_user_logged_in() ) : ?>
<p> Put the info you want displayed in here. </p>
<p class="avatar">
<img src="<?php get_option('home') ?>/wp-content/mu-plugins/bp-xprofile/images/none-thumbnail.gif" alt="No User" />
</p>
<form name="loginform" id="loginform" action="<?php get_option('home') ?>/wp-login.php" method="post">
<p>
<label><?php _e('Username') ?><br />
<input type="text" name="log" id="user_login" class="input" value="<?php echo attribute_escape(stripslashes($user_login)); ?>" /></label>
</p>
<p>
<label><?php _e('Password') ?><br />
<input type="password" name="pwd" id="user_pass" class="input" value="" /></label>
</p>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> <?php _e('Remember Me'); ?></label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" value="<?php _e('Log In'); ?>" tabindex="100" />
<input type="hidden" name="redirect_to" value="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ?>" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
<?php endif ?>
</div>
datzchabchai
Member
Posted 11 months ago #
i have a same problem with vachi but still i wont work i need some guidance from the pro! please help me :(
tnx
Awesome, thank you. I was able to get me a cool sidebar-login thing going as well :)
I just had to remove the avatar thing, and I removed the form when the user is logged in.
<?php if ( is_user_logged_in() ) : ?>
<h1>Welcome back, user</h1>
<a href="/wp-login.php?action=logout">log out</a>
<?php else : ?>
<h1>Login</h1>
<form name="loginform" id="loginform" action="<?php bloginfo('url'); ?>/wp-login.php" method="post">
<table border="0">
<tr><td>Benutzername:</td><td>Passwort:</td></tr>
<tr>
<td><input type="text" class="rounded" name="log" id="user_login" value="<?php echo attribute_escape(stripslashes($user_login)); ?>"></td>
<td><input type="password" class="rounded" name="pwd" id="user_pass"></td>
</tr>
<tr>
<td><input name="rememberme" type="checkbox" id="rememberme" value="forever" /> angemeldet bleiben?</td>
<td align="right"><input type="submit" value="Login" class="button" name="wp-submit" id="wp-submit"></td>
</tr>
</table>
<input type="hidden" name="redirect_to" value="http://<?php echo $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'] ?>" />
<input type="hidden" name="testcookie" value="1" />
</form>
<?php endif ?>
Now all I need is a pretty registration thingie in the sidebar :)
conradsharry
Member
Posted 8 months ago #
hi vachi do you mind to share us the tutorial how to customize the wp-admin page like you did? thx