Co-authors Plus Plug-In
-
I have activated the Co-authors Plus plug-in. I added the guest authors, but I need to change code for the multiple authors to show up. I am not clear where to make the change in the FlyMag theme as I can’t find where the authors are listed. Likewise, I’m not sure the code in the plug-in works for this theme. Any advice would be appreciated.
Here’s the documentation from the plug-in:
Here is how the plug-in suggests making the changes:
For example, here’s how you would update the_author_posts_link() to instead use coauthors_posts_links():
?
1
2
3
4
5if ( function_exists( ‘coauthors_posts_links’ ) ) {
coauthors_posts_links();
} else {
the_author_posts_link();
}However, the example above is a relatively simplistic way of presenting bylines. There’s a good chance your theme will need an adaptation of it.
For instance, here’s how the change looks for the Hybrid theme:
?
1
2
3
4
5
6
7
8
9function hybrid_entry_author_shortcode( $attr ) {
$attr = shortcode_atts( array( ‘before’ => ”, ‘after’ => ” ), $attr );
if ( function_exists( ‘coauthors_posts_links’ ) ) {
$author = coauthors_posts_links( null, null, null, null, false );
} else {
$author = ‘<span class=”author vcard”>‘ . get_the_author_meta( ‘display_name’ ) . ‘</span>’;
}
return $attr[‘before’] . $author . $attr[‘after’];
}The page I need help with: [log in to see the link]
- The topic ‘Co-authors Plus Plug-In’ is closed to new replies.