I’m trying to implement the Co-Authors Plus Plugin. It says that you will need to change some PHP in the theme. The documentation outlines the changes.
I believe I have found where I would need to change it in my theme. In the post-author-info.php
file:
<?php
/**
* Post Author Info
*
* @package WP Journal
* @subpackage Include
*/
?>
<div id="authorinfo" class="columns alpha omega marT30 marB20">
<a href="<?php the_author_meta('url'); ?>"><?php echo get_avatar( get_the_author_meta('email'), '80' ); ?></a>
<h5 class="marB10"><?php _e('By', 'contempo'); ?>: <a href="<?php the_author_meta('url'); ?>"><?php the_author(); ?></a></h5>
<p><?php the_author_meta('description'); ?></p>
<div class="clear"></div>
</div>
Just adding this line:
<?php if ( function_exists( 'coauthors' ) ) { coauthors(); } else { the_author(); } ?>
â¦seems to give me something that I want. Both “Admin” And “Andrew Gable” are displayed.
But, I’m unsure on how to get it to link correctly, and how to handle photos and multiple Bio’s.
I think you’re looking for something like this article. It’s rather comprehensive, but I’ll just cover the multiple BIOs and avatars. You’ll want to change your HTML code to this instead:
Here we interate through the different authors and display an avatar and BIO section for each one. Any content you add between the
while
andendwhile
statements will be displayed once for each author.You also may want to replace where it says
By Andrew Gable
in the grey bar above the author box (in your template it probably looks like<?php the_author_posts_link() ?>
) with<?php coauthors_posts_links(); ?>
.Duplicate since it is also asked at: https://stackoverflow.com/questions/15119535/editing-theme-to-apply-co-authors-plus/19566948
I had a similar issue and resolved it this way:
Be sure to use that
global $post;
and theforeach
-loop.This function will display an author box containing author image/avatar, author name with link to its archive, and the author’s bio. You might want to use your own theme’s CSS classes though.
The URL bungeshea posted was helpful.