I know you can easily display custom content if a certain logged in user is a certain role using
<?php if ( current_user_can('contributor') ) : ?> media files loop <?php endif; ?>
However, I want to do the same thing, but for a specific username, not the logged in user.
I have user profiles in my wordpress website, some of them are artists, and If the profile being viewed is an artist I want to display their uploaded media. (and nothing to be returned if that profile being viewed is another role.)
I have the variable to get the currently viewed profiles username, I just need the if statement.
Something like:media files loop