WordPress.org

Ready to get started?Download WordPress

Forums

Author Page Display Order (1 post)

  1. richb
    Member
    Posted 1 year ago #

    <?php
    	$authors = $wpdb->get_results('SELECT DISTINCT post_author FROM '.$wpdb->posts);
    	//$authorlink =  the_author_posts_link();
    	if($authors):
    	foreach($authors as $author):
    	?>
    
    		<!-- Begin the first article -->
    		<article class="author-<?php the_author_meta('user_login', $author->post_author); ?> author">
    
    			<div class="postimage">
    				<a href="/author/<?php the_author_meta('user_login', $author->post_author); ?>/" title="<?php the_author_meta('display_name', $author->post_author); ?>">
    				<?php echo get_avatar(get_the_author_meta('user_email', $author->post_author), 350); ?>
    				</a>
    			</div>
    
    			<div class="authorinfo">
    				<h2><?php the_author_meta('display_name', $author->post_author); ?></h2>
    				<?php the_author_meta('description', $author->post_author); ?>
    				<p><a href="/author/<?php the_author_meta('user_login', $author->post_author); ?>/" title="READ POSTS+">READ POSTS+</a></p>
    			</div>
    
    		</article>
    		<!-- Closes the first article -->
    
    	<?php endforeach; endif; ?>

    I have the above code working great for displaying a author list with detailed information. I'm not really great with working with sql, but I need to display this list by the authors nickname. Right now, it is ordered by ID. Any ideas?

    Thanks in advance.
    Rich

Topic Closed

This topic has been closed to new replies.

About this Topic