// the following is with Gravatar, Links to author pages ,and css classes-
<?php
// Arguments to pass to get_users
$args = array( \'orderby\' => \'display_name\', \'order\' => \'ASC\', \'who\' => \'authors\' );
// Query for the users
$authors = get_users( $args ); ?>
<div id="authors-list"><p><strong>Authors: </strong>
<?php
// Loop through all the users, printing their names, with links to their section of the archives
for ( $i = 0; $i < count( $authors ); ++$i ) {
$author = $authors[$i];
echo "<a href=\'#{$author->user_nicename}\'>$author->display_name</a>";
if ( $i < count( $authors ) - 1 ) {
echo \' | \';
}
} ?>
</p></div>
<?php
// Loop through all the users, and grab posts
foreach ( $authors as $author ) { ?>
<a name="<?php echo $author->user_nicename; ?>"></a>
<div class="author-posts-container" id="author-<?php echo $author->ID; ?>-posts-wrapper">
<div class="author-avatar" id="author-<?php echo $author->ID; ?>-avatar">
<?php echo get_avatar( $author->ID, 96 ); ?>
</div>
<div class="author-posts-list" id="author-<?php echo $author->ID; ?>-posts">
<h2><a href="<?php echo get_author_posts_url( $author->ID ); ?>"><?php echo $author->display_name; ?></a></h2>
<?php
// now a loop for each user post
$args = array( \'author\' => $author->ID, \'posts_per_page\' => -1 );
$posts = query_posts($args);
// quasi-loop use get_template_part
// if exists
// get_template_part( \'loop\', \'all-authors\' ); // Pulls in loop-all-authors.php from theme
if ( have_posts() ) : ?>
<ul class="author-post-list" id="author-<?php echo $author->ID; ?>-post-list">
<?php while ( have_posts() ) : the_post(); // Print whatever we want for each post - for now the title and date ?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> — <?php echo get_the_date(); ?></li>
<?php endwhile; ?>
</ul><!-- #author-post-list -->
<?php else: ?>
<p>This author has no posts published</p>
<?php endif; ?>
</div><!-- #author-posts -->
</div><!-- #author-posts-container -->
<?php } // End looping ?>