1. /*-----------------------------------------------------------------------------------*/
  2. /* List admins, contributors, editors and authors for contributors template
  3. /*-----------------------------------------------------------------------------------*/
  4.  
  5. function periodic_contributors() {
  6.     global $wpdb;
  7.  
  8.    
  9. $authors = $wpdb->get_results("
  10.         SELECT  ID, display_name
  11.         FROM wp_users
  12.         INNER JOIN wp_usermeta
  13.         ON wp_users.ID  = wp_usermeta.user_id
  14.             WHERE wp_usermeta.meta_key = 'wp_capabilities'
  15.         AND (wp_usermeta.meta_value
  16.             LIKE '%admin%'
  17.             OR wp_usermeta.meta_value
  18.             LIKE '%contributor%'
  19.             OR wp_usermeta.meta_value
  20.             LIKE '%editor%'
  21.             OR wp_usermeta.meta_value
  22.             LIKE '%author%')           
  23.         ORDER BY display_name
  24.         ");
  25.  
  26.        
  27.         foreach($authors as $author) {
  28.             echo "<li>";
  29.                 echo '<div class="contribute-avatar"';
  30.                 echo "<a href=\"" . home_url() ."/author/"; the_author_meta('user_nicename', $author->ID); echo "/\">";
  31.                 echo get_avatar($author->ID, '75');
  32.                 echo "</a>";
  33.                 echo "</div>";
  34.                 echo '<div class="contribute-text">';
  35.                 echo "<h3><a href=\"". home_url() ."/author/"; the_author_meta('user_nicename', $author->ID); echo "/\">"; the_author_meta('display_name', $author->ID);
  36.                 echo "</a></h3>";
  37.                 echo "<p>";
  38.                 echo the_author_meta('description', $author->ID);
  39.                 echo "</p>";
  40.                 echo "<p>";
  41.                 echo _e('Browse Articles by ','periodic');
  42.                 echo "<a class=\"right-arrow\" href=\"". home_url() ."/author/"; the_author_meta('user_nicename', $author->ID); echo "/\">"; the_author_meta('display_name', $author->ID);
  43.                 echo "</a>";               
  44.                 echo "</p>";
  45.                 echo "</div>";
  46.             echo "</li>";
  47.         }
  48.     }