Skip to content

Instantly share code, notes, and snippets.

@pije76
Created July 27, 2013 02:18
Show Gist options
  • Save pije76/6093393 to your computer and use it in GitHub Desktop.
Save pije76/6093393 to your computer and use it in GitHub Desktop.
enable visitors to access any author profile even if they are not a ‘Top Author’ on article-directory plugin
<ul>
<?php
$uc=array();
$blogusers = get_users_of_blog();
if ($blogusers) {
foreach ($blogusers as $bloguser) {
$post_count = get_usernumposts($bloguser->user_id);
$uc[$bloguser->user_id]=$post_count;
}
arsort($uc);
foreach ($uc as $key => $value) {
$user = get_userdata($key);
$author_posts_url = get_author_posts_url($key);
$post_count = $value;
if ($post_count > 0) {
echo '<li><a href="' . $author_posts_url .'">' . $user->display_name . '</a> (' . $post_count . ')</li>';
}
}
}
?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment