Forums

Get role and/or capabilities of author (3 posts)

  1. Empireoflight
    Member
    Posted 2 years ago #

    I'd like to add some code to my author.php page that will display additional markup depending on the author's role. I'm using the User Role Editor plugin to add additional roles for site contributors. Basically, they are both contributor level, but I want to categorize the contributors.
    How can I determine the role/capability of the author of a post, and show the appropriate markup? Thanks for any help.

  2. Jonas Grumby
    Member
    Posted 2 years ago #

  3. Empireoflight
    Member
    Posted 2 years ago #

    Thanks SS-I've looked over the codexes and lots of threads, but I'm still having trouble. I basically need something like,

    is_author_category ...

    I've tried this:

    global $current_user;
    $current_user = wp_get_current_user();
    $var = the_author_meta('user_level',$current_user);

    but that always shows 10, even if I'm logged out and no matter what capabilities are assigned to the author.

Topic Closed

This topic has been closed to new replies.

About this Topic