Can I Show Multiple Authors in the Post Bylines?

Community Forums Forums Design Tips and Tricks Can I Show Multiple Authors in the Post Bylines?

This topic is: not resolved

This topic contains 5 replies, has 2 voices, and was last updated by  kay9 1 year, 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #34260

    kay9
    Participant
    Post count: 46

    I’d like each blog post to be able to say “Posted on [date] by Author A, Author B, and Author C” or any other combo, like that (“by Author A and Author C”), etc.

    I tried the “Co-Authors Plus” plugin but couldn’t get it to show more than one author in the byline. :(

    Thanks for any clues!

    #34262

    wjdennen
    Participant
    Post count: 6
    #34399

    kay9
    Participant
    Post count: 46

    Gah, thank you so much for the reply! Sorry it took me so long to get back here. OK, I did not try the tags because it looked a bit outside my skill level. I will go look again!

    Thanks!

    #34514

    kay9
    Participant
    Post count: 46

    Hmm, well I don’t understand which file I am supposed to modify, or exactly how, after reading this page. Unfortunately. Do I change the Co-Authors Plus template-tags.php file? Or do I change the theme’s single.php and author.php files?

    #34527

    wjdennen
    Participant
    Post count: 6

    As a simple test, you could add this to your functions.php file, assuming you have the Co-Authors plugin enabled.

    /** Customize the post info function */
    add_filter( 'genesis_post_info', 'kay9_post_info_filter' );
    function kay9_post_info_filter($post_info) {
    if ( !is_page() ) {
    if ( function_exists( 'coauthors_posts_links' ) ) {
    $post_info = '[post_date] by ' . coauthors_posts_links("","","","",false) . ' [post_comments] [post_edit]';
    } else {
    $post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
    }
    return $post_info;
    }}

    #34569

    kay9
    Participant
    Post count: 46

    OK thanks! I added the code you provided to the functions.php file for my child theme. It isn’t doing anything, that I can tell. The authors are not displaying in the “posted by” line at the top of the posts, OR at the end of the posts. And yet, in the draft of the post, I see the three names under the edit post area, as if they WILL be listed when the post is published. Could the fact that the post is in “draft” still be causing the new multi-author byline to NOT show up?

    Baffled here. Maybe I was supposed to modify the code you provided in some way? Sorry to be so dense! I really appreciate your help!

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.