Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] How to detect use is on a bp page

  • @crystalcommerce

    Participant

    I have content I am putting into the sidebar, but I do not want the content to show up when the user is in the members section etc.
    I tried !bp_is_page() but that doesn’t seem to work.
    I just want to detect all bp pages to void them all out.

    Thanks,

Viewing 8 replies - 1 through 8 (of 8 total)
  • @hnla

    Participant

    Did you glance at the current forum topics or search?

     

    There is a very similar question , please read that thread first and see if that helps at all.

    @crystalcommerce

    Participant

    Could you be more specific on the post? I found a recent one where a user wanted to get the members page, what I want is to detect if they are on any of them not just one.
    Thanks

    @shanebp

    Moderator

    I’m also interested in an answer to your question.

    There used to be this bool, but no longer:
    `$is_member_page`

    You could check $bp_unfiltered_uri[0] but I’m not sure that will work if you also have
    `define ( ‘BP_ENABLE_ROOT_PROFILES’, true );`

    @chouf1

    Participant

    @shanebp

    Moderator

    @chouf1

    I don’t think members is a component.

    What does bp_user_query have to do with the OP’s question ?

    What about this ?

    `if ( 0 == bp_displayed_user_id() )
    //show the widget
    `

    @imath

    Moderator

    Hi,

    The different conditionnal tags are located in /bp-core/bp-core-template.php so you’ll find there all you need to restrict the display of content to specific areas.

    For instance, if you want your content to only show when not in members area and not in the user’s area, you can use something like this :

    if( !bp_is_members_component() && !bp_is_user() ) {
    
            echo "not in members or user's area";
    
    }

    @shanebp

    Moderator

    @imath

    Thank you.

    @crystalcommerce

    Participant

    Yea that does work, thanks imath.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] How to detect use is on a bp page’ is closed to new replies.
Skip to toolbar