Skip to:
Content
Pages
Categories
Search
Top
Bottom

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


r-a-y
Keymaster

@r-a-y

Here’s what I’m using for:

My Profile tab:

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

Members tab:

<li<?php if ( bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member() && !bp_is_my_profile()) : ?> class="selected"<?php endif; ?>>
<a href="<?php echo site_url() ?>/<?php echo BP_MEMBERS_SLUG ?>/" title="<?php _e( 'Members', 'buddypress' ) ?>"><?php _e( 'Members', 'buddypress' ) ?></a>
</li>

Slightly simpler than yours. But if there’s an even, simpler way let me know!

Skip to toolbar