I want to display only Authors not any Subscriber who write blog in my website. So can you help me on this?
<?php
//define vars from user selection
$howManyAuthors = 10;
//Get users and count of posts put into array
$authorsArray=array();
$blogusers = get_users_of_blog();
if ($blogusers) {
foreach ($blogusers as $bloguser) {
$post_count = get_usernumposts($bloguser->user_id);
$authorsArray[$bloguser->user_id]=$post_count;
}
arsort($authorsArray);
$maxauthor = $howManyAuthors;
$count=0;
foreach ($authorsArray as $key => $value) {
$count++;
if ($count <= $maxauthor) {
$user = get_userdata($key);
$username = $user->user_login;
$displayname = $user->display_name;
$author_posts_url = get_author_posts_url($key);
$post_count = $value;
$args=array(
'showposts'=>1,
'author'=>$user->ID,
'caller_get_posts'=>1
);
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
while ($my_query->have_posts()) : $my_query->the_post();
?>
<?php
endwhile;
}
?>
<!-- end of topWriterBox -->
<?php
}
}
}
?>
{}
in the editor for code