Requires Co-Authors Plus WordPress Plugin and ACF
Created
August 27, 2017 21:25
-
-
Save solid-pixel/8bc1e3bfef703f5597aeec8021392b66 to your computer and use it in GitHub Desktop.
Display Multiple Authors in Author Box
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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