WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hey i installed buddypress and wanted to know if there is a theme function o can add so that on my theme it says

Login • Sign Up

and when they login it says

My Profile • Sign Out

share|improve this question

closed as off-topic by birgire, gmazzap, Johannes Pille, Joshua Abenazer, ialocin Aug 8 '14 at 21:10

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Your question should be specific to WordPress. Generic PHP/JS/HTML/CSS questions might be better asked at Stack Overflow or another appropriate site of the Stack Exchange network. Third party plugins and themes are off topic." – birgire, gmazzap, Johannes Pille, Joshua Abenazer, ialocin
If this question can be reworded to fit the rules in the help center, please edit the question.

There isn't a specific function that will do this, but it's definitely something you can add to your site. Personally, I've added a custom widget to one of my sites that displays this kind of functionality in the upper-right corner.

Here is some of the code I use:

$current_user = wp_get_current_user();
$email_hash = md5( $current_user->user_email );
<div class="login_widget">
    <?php if ( is_user_logged_in() ) { ?>
        <div class="actions">
                <li class="first-line">Welcome, <?php echo $current_user->display_name; ?>!</li>
                <li><a href="<?php echo admin_url( 'profile.php' ); ?>" title="Profile">Manage Your Profile</a></li>
                <li><a href="<?php echo wp_logout_url( home_url() ); ?>" title="Logout">Log Out</a></li>
        <img src="http://www.gravatar.com/avatar/<?php echo $email_hash; ?>?s=50" alt="Gravatar" width="50" height="50" />
    <?php } else { ?>
        <div class="actions">
                <li class="first-line">
                    <a href="<?php echo wp_login_url( get_permalink() ); ?>">Log in</a> or
                    <a href="<?php echo site_url( 'register' ); ?>">join the community</a>
    <?php } ?>

If the user is logged in, it displays a box like this: Display when user is logged in

If the user is logged out, it displays a line of text like this: Display when user is logged out

share|improve this answer
Something is missing from the top line it doesn't begin with anything, i don't think that will work – Terrell Anderson Mar 3 '12 at 1:08
The only thing that might be missing is an opening <?php tag (which I've now added). But this code will do exactly what I say it will - I copied it from a live site and used the life site to make the screenshots at the bottom of my answer. Have you at least attempted to implement this answer? – EAMann Mar 3 '12 at 3:21
Thank you so much for this :) – Terrell Anderson Mar 3 '12 at 10:27

A quick note that @EAMann's answer isn't BuddyPress-specific. If you want to point to the user's BP profile edit page instead of the WP Dashboard version, replace

admin_url( 'profile.php' )


share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.