Co-Authors Plus
[resolved] Co-authors show up twice (5 posts)

  1. pleasureinstitute
    Posted 3 years ago #

    Hi, everyone.

    Whenever I activate Co-Authors Plus, the authors get echoed one line before getting returned to the page. The result is that the names show up once at the very top of my page, from the echo, and then they show up again below my title, from the return, where they should be.

    I've traced this behavior to the file template-tags.php. In that file, coauthors__echo( $tag, $type = 'tag', $separators = array(), $tag_args = null, $echo = true ) is where authors get echoed and returned.

    if( $echo )
    	echo $output;
    return $output;

    The first thing I tried was to set $echo = false, but I guess another function is specifically passing true to coauthors__echo. In the past I've fixed this by simply commenting out echo $output;, but of course, after every update, this gets undone.

    Is anyone else experiencing this behavior or am I just doing something wrong?


  2. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    Can you share the code you're using to show your co-authors?

  3. pleasureinstitute
    Posted 3 years ago #

    I put the following in a shortcode in my theme's functions.php.

        return coauthors_posts_links();
        return builder_get_author_link();
  4. pleasureinstitute
    Posted 3 years ago #

    Oh, ha. I feel silly. I just noticed,

    function coauthors_posts_links( $between = null, $betweenLast = null, $before = null, $after = null, $echo = true ){

    beneath coauthors__echo().

    Is the API available anywhere? All I found was the VIP page, but that wasn't very detailed.

  5. Daniel Bachhuber
    Hand Built
    Plugin Author

    Posted 3 years ago #

    Sorry about that. The API is detailed in the template-tags.php file. I've updated the PHPdoc for each function.

    I also tried clarifying template tags some on the VIP page. Because each theme is different though, it's hard to provide super-specific instructions.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Co-Authors Plus
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic