oneofayykind Posted June 11, 2010 Share Posted June 11, 2010 So here is what I'm trying to do. I'm using Wordpress. I have added a Login and Register link to my header along with an avatar box next to it like you would see next to someones comment. What I would like to have happen is after someone logs in that default avatar box update to their own avatar (if they have one or show the default avatar if they don't) and then not show the login and register links anymore and instead show a link to their profile. Quote Link to comment Share on other sites More sharing options...
RogerJH Posted June 17, 2010 Share Posted June 17, 2010 Did you look to see if there's a plugin that can do this? Quote Link to comment Share on other sites More sharing options...
calvinklein Posted June 20, 2010 Share Posted June 20, 2010 Use the following code to add a login form to your wordpress theme <?php if (!(current_user_can('level_0'))){ ?> <h2>Login</h2> <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" /> <input type="submit" name="submit" value="Send" class="button" /> <p> <label for="rememberme"><input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> Remember me</label> <input type="hidden" name="redirect_to" value="<?php echo $_SERVER['REQUEST_URI']; ?>" /> </p> </form> <a href="<?php echo get_option('home'); ?>/wp-login.php?action=lostpassword">Recover password</a> <?php } else { ?> <h2>Logout</h2> <a href="<?php echo wp_logout_url(urlencode($_SERVER['REQUEST_URI'])); ?>">logout</a><br /> <a href="http://XXX/wp-admin/">admin</a> <?php }?> Thanks website development australia Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.