I'm using wordpress to design a site that allows multiple users to log into the page. The log in is located in the header at the top of the home page. The problem is, after a user enters their log in information and is logged in, the homepage is not showing that they're logged in. Current users have a user level of 7. Here's the code I've used:
<div id="login">
<?php if (!(current_user_can('level_0'))){ ?>
<form action="<?php echo get_option('home'); ?>/wp-login.php" method="post">
<table>
<tr><td>Username</td>
<td>Password</td>
<td></td></tr>
<tr><td><input type="text" name="log" id="log" value="<?php echo wp_specialchars(stripslashes($user_login), 1) ?>" size="20" /></td>
<td><input type="password" name="pwd" id="pwd" size="20" /></td>
<td><input type="submit" name="submit" value="Login" class="button" /></td></tr>
<td><label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label></td>
<td></td>
<td></td></tr>
</table>
<input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
</form>
<a href="<?php echo get_option('home'); ?>/wp-login.php?action=register">Register for CHIDSapedia</a> -
<a href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Recover password</a>
<?php } else { ?>
<h2><?php global $current_user; get_currentuserinfo(); echo $current_user->display_name; ?></h2>
<a href="<?php echo get_option('home'); ?>/wp-login.php?action=logout">Logout</a><br />
<a href="<?php echo get_option('home'); ?>/wp-admin/">User Dashboard</a>
<?php }?>
</div>