Reply To: Activity Page condition?
// Check if the current component is 'activity'
if ( bp_is_current_component( 'activity' ) ) {
echo "This is the BuddyPress activity page!";
} else {
echo "This is not the BuddyPress activity page.";
}
bp_is_current_component( ‘activity’ )
This function checks if the current BuddyPress component being viewed is ‘activity’. Since BuddyPress 12 doesn’t use WordPress pages for components like activity, this is the correct way to detect if you are on the activity section.