by drbyte » September 25th, 2010, 10:25 pm
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