Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: How do I detect whether I’m on a BuddyPress page?


Roger Coathup
Participant

@rogercoathup

@zamoose – you can use the function: bp_current_component() that returns a boolean

To detect specific pages, you can use bp_is_page() as @modemlooper points out. Use it like this:

bp_is_page( BP_MEMBERS_SLUG )
bp_is_page( BP_ACTIVITY_SLUG )
bp_is_page( BP_GROUPS_SLUG )
bp_is_page( BP_FORUMS_SLUG )
bp_is_page( BP_BLOGS_SLUG )

Other functions (look in bp-core-templatetags.php) include:

bp_is_activity_front_page()
bp_is_activity_component()
bp_is_directory()
bp_is_home()

etc.

there are lots of them

Skip to toolbar