SHARE
TWEET

Untitled

jurgemaister Jan 29th, 2013 103 Never
  1. <?php
  2. /**
  3.  * Echo Filtered List
  4.  */
  5. function filtered_list() {
  6.     $authors = get_users('orderby=nicename');
  7.     $all_authors = array();
  8.     foreach($authors as $author)
  9.         if(count_user_posts($author->id) > 0) {
  10.             array_push($all_authors, $author)
  11.         }
  12.     }
  13.     return $all_authors;
  14. }
  15.  
  16. function contributors() {
  17.     $authors = filtered_list();
  18.     for($i = 0; $i < count($authors); $i++) {
  19.         if ($i == count($authors) - 1) {
  20.             echo "<li class='author-last clearfix'>";
  21.         } else {
  22.             echo "<li class='author clearfix'>";
  23.         }
  24.     }
  25. }
  26. ?>
RAW Paste Data
Top