• Resolved 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="https://opinionupdate.com/author/admin/" title="Posts by admin" rel="author">admin</a> and <a href="https://opinionupdate.com/author/guest-author/" title="Posts by Guest Author" rel="author">Guest Author</a><div class="single-thumbnail-author"> by <a href="https://opinionupdate.com/author/admin/" title="Posts by admin" rel="author">admin</a> and <a href="https://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:
    https://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

    https://www.ads-software.com/extend/plugins/co-authors-plus/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter 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 Contributor Daniel Bachhuber

    (@danielbachhuber)

    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.

    Thread Starter gdfwilliams

    (@gdfwilliams)

    Thanks, Daniel!

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