Create a Contributors Page

Applies to Version(s): Thesis 1

If you have a multi-author blog, listing all of the authors (or “contributors”) on a single page is a nice way to promote all of the authors. Here’s how to create a custom contributors page in Thesis.

First, go to Pages > Add New in WordPress, and create a new page named Authors. In the Template dropdown under Page Attributes, select Custom Template. Publish the page.

Then, place the following code in your custom_functions.php file:

function list_all_authors() {
	if (is_page('Authors')) {
    global $wpdb;
    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name");
    foreach ($authors as $author ) { 
    $aid = $author->ID; ?>
	    <div class="author_info <?php the_author_meta('user_nicename',$aid); ?>">
			<span class="author_photo"><?php echo get_avatar($aid,96); ?></span>
        	<p><a href="<?php get_bloginfo('url'); ?>/author/<?php the_author_meta('user_nicename', $aid); ?>"><?php the_author_meta('display_name',$aid); ?></a></p>  
        	<p><?php the_author_meta('description',$aid); ?></p>
        	<p class="author_email"><a href="mailto:<?php the_author_meta('user_email', $aid); ?>" title="Send an Email to the Author of this Post">Contact the author</a></p>
        </div> 
	<?php }
	}
}
add_action('thesis_hook_custom_template','list_all_authors');	
remove_action('thesis_hook_custom_template','thesis_custom_template_sample');	

To style the listing, you’ll need to add the following to your custom.css file to use as a starting point:

.custom .author_info {
	clear:both; 
	overflow:hidden; 
	border:1px dotted #666; 
	width:28em; 
	padding:1.0em; 
	margin-bottom:1em; 
	margin-top:1em; 
	font-family:Arial; 
	font-size:14px; 
} 
.custom .author_info a { 
	color:#cc0000; 
	border-bottom:1px dotted #fff; 
	text-decoration:none; 
} 

.custom .author_info a:hover { 
	border-bottom:1px dotted #cc0000; 
} 

.custom .author_info .author_photo img { 
	display:block; 
	border:1px dotted #666; 
	padding:0.2em; 
	float:left; 
	margin:1.0em 1.0em 1.0em 0em; 
} 

.custom .author_info p { 
	margin-top:0.8em; 
	margin-bottom:0.4em; 
}