Page 1 of 1
Login page
Posted:
September 22nd, 2010, 4:59 pm
by ohadga
Hi,
Registered user that are entering my site:
1. Can i have the login page as part of my home page or must it be a ling that opens wp-login.php in a different page?
2. Can i have the name of my user displayed in my website header (or somewhere else)?
Thanks in advance,
Ohad
http://www.myhobbymaster.com
Re: Login page
Posted:
September 25th, 2010, 2:36 pm
by ohadga
Hi,
I'll appriciate any help with this issue, we installed s2member but we don't know how to progress and make the login page as part of our home page.
Thanks again!
Ohad
Re: Login page
Posted:
September 25th, 2010, 10:25 pm
by drbyte
the second part of your question....
add this code to where you want the name of the user to be displayed
<?php global $current_user;
get_currentuserinfo();
echo 'Welcome: ' . $current_user->display_name . "\n"; ?>
The first part of your question (login in front page)
You can add the code below to any page you want inside the wp loop
<form name="loginform" id="loginform" action="<?php echo site_url('index.php', 'login_post') ?>" method="post">
<p>
<label><?php _e('Username') ?><br />
<input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" tabindex="10" /></label>
</p>
<p>
<label><?php _e('Password') ?><br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
</p>
<?php do_action('login_form'); ?>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90"<?php checked( $rememberme ); ?> /> <?php esc_attr_e('Keep me logged in'); ?></label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="<?php esc_attr_e('Log In'); ?>" tabindex="100" />
<?php if ( $interim_login ) { ?>
<input type="hidden" name="interim-login" value="1" />
<?php } else { ?>
<input type="hidden" name="redirect_to" value="<?php echo esc_attr($redirect_to); ?>" />
<?php } ?>
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
Sam
Re: Login page
Posted:
September 26th, 2010, 4:10 pm
by ohadga
Hi,
When i add the second code (didn't try the first yet) i got the attached error.
Am i doing something wrong? Should i simply paste it into the side bar??
Thanks a lot!
Ohad
Re: Login page
Posted:
September 26th, 2010, 9:50 pm
by drbyte
make sure you ad it within WP loop...
http://codex.wordpress.org/The_Loop