You are here:Home » genesis framework » Add Author Box to End of Posts in Genesis Child Themes

Add Author Box to End of Posts in Genesis Child Themes

Under WordPress Dashboard -> Users -> Your Profile -> Genesis User Settings. Check on the box “Enable Author Box on this User’s Posts”.
But if your blog is a multi-author site then instead of editing each user profile you can use following code to show author box at the end of each post. Add following code in functions.php.
/** Add author box to end of posts **/
function abr_author_box () {
	$html = '<div class="author-box">';
	$html .=  get_avatar(get_the_author_meta('user_email'), 75); 
	$html .= '<strong>About <a href="'.get_author_posts_url(get_the_author_meta( 'ID' )).'">'.get_the_author_meta('user_firstname').' '.get_the_author_meta('user_lastname').'</a></strong><br />';
	$html .= wpautop(get_the_author_meta('description'));
	$html .= '</div>';
	echo $html;
}
add_action ( 'genesis_before_comments', 'abr_author_box', 10, 1);
Above code will add author box below each post as shown in the figure below:

1 comment:

  1. Do you know how to have the author appear on Genesis child themes on the same line as the publishing date (before the post), as it does on default Wordpress themes? It would be nice to have this option instead of the Author Box.

    ReplyDelete