Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

 
discard

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

Browse other questions tagged or ask your own question.