Displaying Featured Image for Author instead of Gravatar
-
Below is code I am using for displaying the authors’ featured image instead of the gravatar along with their name and bio on the single post:
<?php foreach( get_coauthors() as $coauthor ) : ?> <div class="authorinfo"> <?php echo get_the_post_thumbnail($coauthor->ID, 'thumbnail'); ?> <h5><?php echo $coauthor->display_name; ?></h5> <p><?php echo $coauthor->description; ?></p> <div class="clear"></div> </div> <?php endforeach; ?>
This code works on the single.php template (actually the content.php template for my theme). I hope this helps those who have been struggling with how to display the author Featured Image.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Displaying Featured Image for Author instead of Gravatar’ is closed to new replies.