Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Genesis - add author info to author archive pages
<?php
add_action('genesis_before_loop', 'sgr_author_info', 20);
/**
* Function to display author details on the author archive page
*
* Here, we're hooking to genesis_before_loop so that it displays
* above the posts output
*
* @author Ade Walker http://www.studiograsshopper.ch
* @uses get_query_var()
*
* @return echo out the author's details
*/
function sgr_author_info() {
if( !is_author() ) return;
if( get_query_var('author') ) {
global $wp_query;
$curauth = $wp_query->get_queried_object();
}
$bio = $curauth->description;
$name = $curauth->display_name;
$website = $curauth->user_url;
echo '<p>All posts by : ' . $name . '</p>';
echo '<p>About ' . $name . ' ' . $bio . '</p>';
echo '<p>Website: <a href="' . $website . '">' . $website . '</p>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.