Skip to content

Instantly share code, notes, and snippets.

@mjangda
Created June 22, 2010 13:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjangda/448471 to your computer and use it in GitHub Desktop.
Save mjangda/448471 to your computer and use it in GitHub Desktop.
A fix for Author Templates for the Co-Authors Plus WordPress plugin where the author's name and bio are incorrect
<?php
// Add this to your author.php template between the first the_post() call and where the bio is outputted.
if( is_author() ) {
global $wp_query;
// Get the id of the author whose page we're on
$author_id = $wp_query->get( 'author' );
// Check that the the author matches the first author of the first post
if( $author_id != get_the_author_meta( 'ID' ) ) {
// The IDs don't match, so we need to force the $authordata to the one we want
global $authordata;
$authordata = get_userdata( $author_id );
}
}
?>
@andipollok
Copy link

Works perfectly, thank you. Used on http://ied.rca.ac.uk/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment