Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: buddypress user roles different colours

@hnla

Participant

@planetoffitness
If you inspect the generated markup you will see that the loop list elements will have a members type class rendered if user has a type you can then use those to effect styling on.

In the member single screens it’s a little trickier you do have the ability to use the template hierarchy to set a template for a user type (please refer to the codex for instruction) otherwise for the moment you would need to modify the home.php template to add this yourself something like:

<?php $user_type = bp_get_member_type( bp_displayed_user_id() ); ?>

<div id="buddypress" class="<?php echo esc_attr( $user_type ); ?>">

First line is an addition the second you need to modify the existing element to add the class and php – all in a child copy of the home.php template naturally.
We will update buddpress core to add a class to the body elements for 2.8 as this would be useful and styling could be effected on that too so if you would rather wait for 2.8…

Skip to toolbar