WordPress.org

Support

Support » Plugins and Hacks » Co-Authors Plus » [Resolved] Duplicate author/co-authors showing in posts

[Resolved] Duplicate author/co-authors showing in posts

  • gdfwilliams

    @gdfwilliams

    Daniel, Thanks for your work on a great plug-in.

    I am using the following to insert author info onto a post page:

    echo '<div class="single-thumbnail-author"> ' . __('by','gdl_front_end') . ' ' . coauthors_posts_links() . '</div>';

    When I do (and regardless of whether I’m pulling coauthors_post_links() or just their display name, first name, or last name, I always get a return that inserts both author and co-author twice like this:

    by admin and Guest Authoradmin and Guest Author

    When I look at the source code, I see that it inserts two separate divs:
    <a href="http://opinionupdate.com/author/admin/" title="Posts by admin" rel="author">admin</a> and <a href="http://opinionupdate.com/author/guest-author/" title="Posts by Guest Author" rel="author">Guest Author</a><div class="single-thumbnail-author"> by <a href="http://opinionupdate.com/author/admin/" title="Posts by admin" rel="author">admin</a> and <a href="http://opinionupdate.com/author/guest-author/" title="Posts by Guest Author" rel="author">Guest Author</a></div>

    Any ideas? I’m using the Bangkok Press theme, installed here:
    http://opinionupdate.com/2012/11/23/vulputate-nibh-cras/

    Thanks again for all of your hard work — and for any suggestions about this particular issue.

    GDW

    http://wordpress.org/extend/plugins/co-authors-plus/

Viewing 3 replies - 1 through 3 (of 3 total)
  • gdfwilliams

    @gdfwilliams

    On line 196 of template-tags.php, if I change
    $echo = true
    to:
    $echo = false
    it resolves the issue describe above. Is this advisable, or will it hurt future updates?

    Thanks,
    GDW

    Plugin Author Daniel Bachhuber

    @danielbachhuber

    Hand Built

    It would be better to use:

    echo '<div class="single-thumbnail-author"> ' . __('by','gdl_front_end') . ' ' . coauthors_posts_links( null, null, null, null, false ) . '</div>';

    Passing false as the last argument means the authors will be returned, instead of echoed.

    gdfwilliams

    @gdfwilliams

    Thanks, Daniel!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Duplicate author/co-authors showing in posts’ is closed to new replies.
Skip to toolbar