1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
      $blog_url = get_bloginfo('home');
      $blogusers = get_users('orderby=display_name');
      foreach ($blogusers as $user) {
        $cpt_count = wpse31443_author_has_custom_post_type( $user->ID, 'weekly-todo' ) . 
                     wpse31443_author_has_custom_post_type( $user->ID, 'food' ) . 
                     wpse31443_author_has_custom_post_type( $user->ID, 'music' ) .
                     wpse31443_author_has_custom_post_type( $user->ID, 'photo' ) .
                     wpse31443_author_has_custom_post_type( $user->ID, 'fashion' ) .
                     wpse31443_author_has_custom_post_type( $user->ID, 'post' );
        
        if (!empty($cpt_count)) {
          echo '<li><a href="' . $blog_url . '/author/' . $user->user_login . '">' . $user->display_name . '</a>' . $cpt_count1 . '</li>';
        }
      }
    ?>