Add Author Bio to Author Archives
This snippet adds the author's biography to the top of author archive pages, providing context for the author's posts.
PHP
function add_author_bio_to_archive() {
if (is_author()) {
echo '<div class="author-bio">';
echo get_avatar(get_the_author_meta('ID'), 60);
echo '<h3>' . get_the_author() . '</h3>';
echo '<p>' . get_the_author_meta('description') . '</p>';
echo '</div>';
}
}
add_action('archive_template', 'add_author_bio_to_archive');
Snippet Feedback
Did this snippet work for you? Do you have any questions about this snippet? Leave some feedback below.
SHARED BY