Skip to:
Content
Pages
Categories
Search
Top
Bottom

Re: [Resolved] body_class filter for buddypress pages

@hnla

Participant

That code test as working on a local BP install and in a custom BP theme so no it’s not a BP issue as such. All standard BP screens show the class added for the given browser. BP simply grabs the array $classes amd merges it’s own set of classes to that array before it’s rendered to browser, I ran the code from my functions.php so you may have some form of priority issue in when bp is cutting in and grabbing the array to merge to, but this is more to do with your theme I would guess and at what point that function is running. do try testing this function on a plain vanilla BP i.e swap to bp-default to test whether it works.

On a sidenote be wary of user agent sniffing it has never been considered a suitable way/ method of establish a user agent due to UA spoofing a regular and common practise that historically meant one couldn’t be sure of the query result being valid.

Skip to toolbar