WordPress.org

Ready to get started?Download WordPress

Forums

List Authors by most recent posts? (3 posts)

  1. Maxaud
    Member
    Posted 6 years ago #

    I'd like to list the authors in sidebar and have them sorted by the most recent posters.

    I currently use the following code to list the authors as I wanted their avatars, name, and link to their website also.

    <div class="bottombar"><h2 class="widgettitle">Contributors:</h2>
    	<ul>
        		<?php
    			$order = 'user_nicename';
    			$user_ids = $wpdb->get_col("SELECT ID FROM $wpdb->users ORDER BY $order"); // query users
    				foreach($user_ids as $user_id) : // start authors' profile "loop"
    			$user = get_userdata($user_id);
    		?>
    		<li>
    			<table>
    				<tr>
    					<td>
    						<a href="/home/authors/<?php echo $user->user_nicename; ?>" alt="<?php echo $user->nickname; ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/authors/<?php echo $user->last_name; ?>.jpg" alt="<?php echo $user->nickname; ?>" border="1" /></a>
    					</td>
    					<td>
    						<?php echo '<a href="' . $user->user_url . '">' . $user->display_name . '</a>'; ?><br />
    						<?php echo '<a href="' . $user->user_url . '">View Website</a>'; ?><br />
    						<a href="/home/authors/<?php echo $user->user_nicename; ?>" alt="<?php echo $user->nickname; ?>">Profile</a>
    					</td>
    				</tr>
    			</table>
    		</li>
    		<?php	endforeach;
    			// end of authors' profile 'loop'
    		?>
    	</ul>
    </div>

    Any help would be much appreciated

  2. hieronymus
    Member
    Posted 6 years ago #

    i would LOVE the ability to do this as well. anyone?

  3. Maxaud
    Member
    Posted 6 years ago #

    So, is there no way to do this?

Topic Closed

This topic has been closed to new replies.

About this Topic