Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: Tip: improve top nav – add My Profile which includes activity and profile


Dwenaus
Participant

@dwenaus

CORRECTION to work well with logged-out users:

the first chunk should contain an if statement to only show the My Profile if the user is logged in:

<?php if ( bp_loggedin_user_id() ) : ?>
<li<?php if ( bp_loggedin_user_id() == bp_displayed_user_id() ) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo bp_loggedin_user_domain() ?>" title="<?php _e( 'My Profile', 'buddypress' ) ?>"><?php _e( 'My Profile', 'buddypress' ) ?></a>
</li>
<?php endif; ?>

and the second part for the members section should be this line, instead of the line I mentioned above:

<li<?php if ( ( bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() ) && ( bp_loggedin_user_id() != bp_displayed_user_id() || !bp_loggedin_user_id() ) ) : ?> class="selected"<?php endif; ?>>

Skip to toolbar