WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been trying to set a conditional for specific users (e.g. http://www.mywebsite.org/forum/users/john/) to display a custom "Contributor" graphic within their user profiles. The graphic would be displayed directly underneath the specified profile pics using the template file (bbpress/templates/default/bbpress/user-details.php).

I was also thinking that it might be easier to set the conditional based on their WordPress user role (e.g. Contributor), so that I wouldn't have to write each user in the condition manually.

Here's what I've tried so far:

<?php if(current_user_can('contributor')) { ?>
<img src="/wp-content/uploads/contributor.jpg" />
<?php } ?>

I've also tried:

<?php if(bb_user_id('15')) { ?>
<img src="/wp-content/uploads/contributor.jpg" />
<?php } ?>

I'm very new to PHP, and I've been trying very hard to find the answer. If you can help me, I would appreciate it very much! Thanks.

share|improve this question
Are you editing BBPress files? If so, that is going to make updating painful. – s_ha_dum Feb 14 '13 at 1:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.