Show Image Under Username Based on WordPress(not bbpress) Role?
-
Well here’s what i’m trying to do..
I want to show an images below usernames in my bbpress forums, based on the WordPress role of each forum poster.
Here’s what i figured out so far:
– I found out that i need to edit loop-single-reply.php to show something under username.
– I figured out (i think :P) that bp_get_reply_author_id() is the string that gets the details of the bbpress poster.Now here’s what i got so far:
global $current_user;
bp_get_reply_author_id();
switch (true) {
case ( user_can( $current_user, “subscriber”) ):
echo ‘image’;
break;
case ( user_can( $current_user, “contributor”) ):
echo ‘image’;
break;
case ( user_can( $current_user, “administrator”) ):
echo ‘image’;
break;
}My code doesn’t work. I cannot get it to show an image based on the WP role (not bbpress) of the user. Can anyone help?
- You must be logged in to reply to this topic.