• Below is the code that displays authors with a minimum of 20 posts and outputs the posts.

    How can I modify it either
    1) add a column for monthly posts or
    2) same row and add a “,” for posts current month?

    //sort users descending by number of posts
    $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 > 20 )  echo '<br>';
    if ($post_count > 21 )  echo '<a href="' . $author_posts_url .'">' . $user->user_login . '</a> - '  . $post_count .  ' posts';
    
      }
    }
      }

The topic ‘List Authors total posts [code included] need current month’ is closed to new replies.