Support » Plugin: Co-Authors Plus » author.php template questions

  • Hi,
    I am working on the author.php file and if I click an author’s link who has worked on a post with another author, that author’s profile displays both authors on the page. For instance, if Mike and Paul worked on post#1 together, but Mike was the only author of post#2, Mike’s profile says “Mike and Paul” instead of just displaying Mike’s information. Am I missing something?


Viewing 1 replies (of 1 total)
  • I experienced this too.

    The template tags the_author() and get_the_author() are both filtered by CAP when the filter coauthors_auto_apply_template_tags returns true. Thus these functions will output co-authors. Specifically, this happens in the filter function CoAuthors_Template_Filters->filter_the_author() and therefore when the_author() is called outside of the loop it will express any co-authors in the first post in the loop.

    Instead of using the_author() in my header of my author.php template, I did something like this:

    echo esc_html( get_the_author_meta( 'display_name' ) );

    Not sure how bulletproof a solution that might be.

Viewing 1 replies (of 1 total)
  • The topic ‘author.php template questions’ is closed to new replies.