"Community" top level nav item not "selected" when on individual member

<li<?php if ( bp_is_page( BP_BLOGS_SLUG ) || bp_is_page( BP_FORUMS_SLUG ) || bp_is_page( BP_ACTIVITY_SLUG ) || bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() || bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member()) : ?> class="selected"<?php endif; ?> id="communitynav">

The way I understand it (and the way it works for groups and forums), is that 'bp_is_page( BP_MEMBERS_SLUG )' as implemented above should display 'class="selected"' when the URL shows an individual member, such as domain.com/members/Admin just it does when it shows the member list: domain.com/members.

But in fact, when showing individual members, the "selected" class is not invoked. Why not? How do I fix this? You can see the issue here: http://www.nmtechcouncil.net/members

  • raygulick

    Thanks, David. Please visit the URL. You will see that on nmtechcouncil.net/members the "Community" item has a class of "selected", so it is highlighted. However, when clicking on any member, so that the URL is nmtechcouncil.net/members/whatever, the "selected" class is no longer activated, and "Community" is not highlighted.

    This only happens in the "Members" section. Navigate to "Forums", then select the forum in existence, and "Community" maintains its "selected" class.

    It appears to me that the IF statement included in the code on my original inquiry should activate the "selected" class for any URL which contains the "members" slug, as it does for the "forums" slug.

  • Richie_KS

    hi raygulick
    user individual profile group in bp_is_profile_component()..thats why they didnt get highlight
    try edit the condition like this

    <li<?php if ( bp_is_profile_component() || bp_is_page( BP_BLOGS_SLUG ) || bp_is_page( BP_FORUMS_SLUG ) || bp_is_page( BP_ACTIVITY_SLUG ) || bp_is_page( BP_GROUPS_SLUG ) || bp_is_group() || bp_is_page( BP_MEMBERS_SLUG ) || bp_is_member()) : ?> class="selected"<?php endif; ?> id="communitynav">

    add in bp_is_profile_component()

    cheers

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.