Co Author Plus: Need to add co authors names with link

22 views Asked by At

I am working on a project and trying to add post author names, e.g., Author 1 and Author 2, with links to all their profile pages. $author_post_links does the job, but it displays Author 1, Author 2, and Author 3 with links in a row. However, I need to show authors separately in the rows, as shown in the image below.

Here is a output but links are missing

My code

if (function_exists('coauthors_posts_links')) {
  $author_post_links = coauthors_posts_links( null, null, null, null, false );
} else {
  $author_post_links = '<a class="url fn n" href="' .
      esc_url( get_author_posts_url( $author_id ) ) .
      '">' . esc_html( get_the_author_meta( 'display_name', $author_id ) ) . '</a>';
}
$byline = sprintf(
  __('by %s'),
  '<span class="author vcard">' . $author_post_links . '</span>' );


$coauthors = get_coauthors();
if ( ! $coauthors ) {
  return;
}
foreach( $coauthors as $coauthor ) { 
 $avatar = coauthors_get_avatar( $coauthor, 150, '', $coauthor->display_name, '');
 echo <<<EOT

  <li class="bottom-multi-author" >  
      <div class="bottom-multi-author-metabox" id="{$coauthor->ID}">
       <figure class="bottom-author-avatar">{$avatar}</figure>
       <div class="bottom-author-details">
       <h4 class="multi-author-name">{$coauthor->display_name} {$url}</h4>
       <h4 class="multi-author-nameewew">{$author_post_links}</h4>
       <h6 class="multi-author-designation">{$coauthor->author_designation}</h6>
       <p class="multi-author-bio">{$coauthor->description}</p>
      
    
       </div>
     
      </div>
      </li>
      
  EOT;
}
?></ul>

<?php 

?>
0

There are 0 answers