1

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.

  • 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 clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.