Skip to content

Instantly share code, notes, and snippets.

@solid-pixel
Created August 27, 2017 21:25
Show Gist options
  • Save solid-pixel/8bc1e3bfef703f5597aeec8021392b66 to your computer and use it in GitHub Desktop.
Save solid-pixel/8bc1e3bfef703f5597aeec8021392b66 to your computer and use it in GitHub Desktop.
Display Multiple Authors in Author Box

Requires Co-Authors Plus WordPress Plugin and ACF

<div id="author-info">
<?php while($i->iterate()){ ?>
<div id="author-image">
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>">
<?php
$author_id = get_the_author_meta('ID');
$author_image = get_field('author_image', 'user_' . $author_id );
$size = 'full';
if( $author_image ) {
echo wp_get_attachment_image( $author_image, $size );
}
?>
</a>
</div>
<div id="author-details">
<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' ) ); ?>" rel="nofollow" target="_blank">
<?php the_author_meta( 'first_name' );?>
<?php the_author_meta( 'last_name' );?>
</a>
<a href="mailto:<?php the_author_meta( 'user_email' );?>">
<?php the_author_meta( 'user_email' );?>
</a>
</div>
<?php } ?>
</div>
<!--Author Info-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment