Advertisement
joelgoodman

Blog User Listing

Apr 19th, 2012
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. <ul class="bloggerGrid">
  2. <?php
  3. $user_args = array(
  4. 'orderby' => 'display_name',
  5. 'order' => 'ASC'
  6. );
  7. $authors = get_users( $user_args );
  8.  
  9. // Loop through users
  10. foreach ( $authors as $author ) {
  11. ?>
  12. <li class="theBlogger">
  13. <a href="<?php echo get_author_posts_url( $author->ID ) ?>" title="Read all posts by <?php echo $author->display_name; ?>">
  14. <?php echo get_avatar($author->ID, 50); ?>
  15. <h4><?php echo $author->display_name; ?></h4>
  16. <p><?php the_author_meta('description', $author->ID); ?></p>
  17. <?php // Setup loop for user post(s)
  18. $post_args = array(
  19. 'author' => '$author->ID',
  20. 'post_count' => 1
  21. );
  22. $auth_posts = new WP_Query( $post_args );
  23. if ( $auth_posts->have_posts() ) : while ( $auth_posts->have_posts() ) : $auth_posts->the_post();
  24. ?>
  25. <p><span class="leaderText">Latest Post:</span> <?php the_title(); ?></p>
  26. <?php
  27. endwhile; else :
  28. ?>
  29. <p>This author has not yet published any posts</p>
  30. <?php
  31. endif; wp_reset_query();
  32. ?>
  33. </a>
  34. </li>
  35. <?php } //End loops ?>
  36. </ul>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement