Get the user type of an author

One way would be to use the get_the_author_meta function and pass it user_level

More info on the function: http://codex.wordpress.org/Function_Reference/get_the_author_meta

Then, see this chart to convert user levels to roles (unless you have created custom roles):
http://codex.wordpress.org/Roles_and_Capabilities#User_Level_to_Role_Conversion

Example code

$level = get_the_author_meta('user_level');

if($level >= 8) { // Is admin
    // do something
} else if ($level > 2 && $level < 8) { // is editor
    // do something else
}

Leave a Comment