Co-Authors Plus
author.php template questions (2 posts)

  1. abloomVML
    Posted 2 years ago #

    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?



  2. natebot
    Posted 2 years ago #

    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.

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


No tags yet.