Skip to:
Content
Pages
Categories
Search
Top
Bottom

Is it profile or members conditional tags?

  • @macpresss

    Participant

    Hello guys.

    I’m trying to hijack this menu and place it inside my header.php file.
    members nav

    This menu gets echoed via the bp_get_displayed_user_nav() function that is only visible on user profile related pages so I need some sort of conditional PHP tag to prevent it from showing up in my header section when I’m not viewing one of those profile related pages of course. For some reason I can’t figure it out anymore. It’s been a while since I’ve used BuddyPress.

    Not visible here
    [domain]/members/

    Yes show me here
    [domain]/members/warrick-brown/
    [domain]/members/warrick-brown/profile/
    [domain]/members/warrick-brown/groups/
    [domain]/members/warrick-brown/anything-else/

    I tried; if bp_is_members_component() > true > echo the menu but that doesn’t seem to work. I probably need to go deeper into the single profile section or something.

    ?

Viewing 4 replies - 1 through 4 (of 4 total)
  • @shanebp

    Moderator

    Try bp_is_user() which should return true on [domain]/members/warrick-brown/etc.

    @r-a-y

    Keymaster

    bp_is_member() is deprecated.

    Use bp_is_user() instead.

    @henrywright

    Moderator

    I’ve just removed bp_is_member() from the Template Tag Reference so there’s no confusion going forward:

    Template Tag Reference

    @macpresss

    Participant

    Yes, bp_is_user() does the job. Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.
Skip to toolbar