Get $curauth level

toscho is correct. User levels have been deprecated for a long time now. However, the following will get you the available information about the author of the posts on an author archive page.

$author = get_queried_object();
var_dump($author);

In that dump you should see everything you need, but use the role not the user level– look in $author->roles. For example:

$author = get_queried_object();
$allowed = array('author','editor','administrator');
$roles = array_intersect($author->roles,$allowed);
if (!empty($roles)) {
  include (TEMPLATEPATH . '/author_1.php');
} else {
  include (TEMPLATEPATH .'/author_2.php');
}

You should also almost certainly be using get_template_part instead of include.

Leave a Comment