I am trying the co-author plus plugin and wonder how the template can be modified to show all authors as individual sections
ie
Author one: description
Author two: description
Multiple authors support
4 posts from 2 voices-
Posted 1 year ago #
-
Hey,
I don't know the plugin and how it outputs the author info but basically it should be possible to output the text above or below the related post section. Open up single.php and and insert the co-author plus plugin function/code above or below following code:
//show related posts if there are any get_template_part( 'includes/related-posts');Posted 1 year ago # -
I always try to share code with others so here is what I came up with. Once you have the plugin installed and have several authors for a post, the authors will show below the post with their photo to the left and their bio description on the right. Open single.php and replace the code after the author-info part. I also have another plug in called user photo that enables you to add profile photos to your authors.
<div class="author-info"> <h3> <?php _e('About the author(s)','newscast'); ?> </h3> <?php $description = get_the_author_description(); if($description != '') { echo $description; } else { _e('The author didnt add any Information to his profile yet','newscast'); } ?> <?php $i = new CoAuthorsIterator(); print $i->count() == 1 ? 'Author: ' : 'Authors: '; $i->iterate(); the_author(); echo"<br/><br/><br/>"; while($i->iterate()){ print $i->is_last() ? ' ' : ', '; ?> </div><div class="gravatar"> <?php $author_email = get_the_author_email(); userphoto_the_author_thumbnail(); the_author_posts_link(); ?> </div> <div class="author-info"><?php $description = get_the_author_description();echo $description; echo "<br>"; } ?> </div>I hope this helps others who want to show photos and bios for multiple authors on posts
EDIT: mods please move this to newscast, I posted it in brightbox it should be in newscast, thanks
Posted 1 year ago # -
I moved it - thanks for the code snippet btw.
Posted 1 year ago #
Reply
You must log in to post.














