Conditional tags to differentiate between profiles and activity with buddypress [closed]

Your problem may be the choice of bp_is_user_profile(). This only returns true when you are literally looking at the xprofile component – the ‘Profile’ tab of a user’s page. bp_is_user() is more general, returning true whenever you’re viewing a user page (even if it’s user activity, user groups, etc).


After further discussion with the OP, it looks as if the culprit is is_page(). Since BP 1.5, BuddyPress uses WP Pages to display content. That means that the is_page() case was returning true. To exclude BP content from this condition, amend your check as follows:

is_page() && !bp_is_blog_page()

Alternatively, if you want the is_page() content to show on BP content too, except for user pages,

is_page() && !bp_is_user()

or, to limit it to the profile,

is_page() && !bp_is_profile_component()