首先,我要说的是,使用“订阅者”角色并不“奇怪”。请注意,您正在从结果中删除“订阅者”角色。
仅获取作者并排除某些ID的正确方法是使用role
和exclude
的参数get_users()
功能:
<?php
$args = array(
\'role\' => \'author\',
//authors with ID 2 and 3 will be excluded
\'exclude\' => array( 2, 3 ),
\'orderby\' => \'post_count\',
\'order\' => \'DESC\'
);
$authors = get_users( $args );
?>
<section class="content" role="main">
<?php
printf( \'<h1>%s</h1>\', the_title() );
foreach($authors as $author) {
?>
<div class="col-xs-6 col-md-3">
<div class="col-lg-12">
<div class="thumbnail">
<?php echo get_avatar( $author->user_email, \'200\' ); ?>
</div>
<div class="caption">
<h4><?php echo $author->display_name; ?><small><?php echo stripslashes(esc_attr( get_the_author_meta(\'job_titel\', $curauth->ID ) ) ); ?></small></h4>
<p> locatie </p>
<p><a href="<?php echo get_author_posts_url( $author->ID ); ?>"> Bekijk profiel</a></p>
</div>
</div>
</div>
<?php } ?>