• Hello,
    how to use function coauthors_get_avatar ?
    Does anybody have a code example?

    I just want to display the coauthors avatar.

    Bye Martin

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello Martin ??

    Where exactly do you want to display the co-author avatars? At the moment, function coauthors_get_avatar() simply shows the co-author avatars in the page/post editor.

    $coauthors = get_coauthors();
    
    if ( ! $coauthors ) {
      return;
    }
    
    foreach( $coauthors as $coauthor ) { 
    
      $avatar = coauthors_get_avatar( $coauthor, 150, '', $coauthor->display_name, '' );
    
      echo <<<EOT
      <div class="author-metabox" id="{$coauthor->ID}">
        <figure class="avatar">{$avatar}</figure>
        <div class="author-meta">
          <h4>{$coauthor->display_name}</h4>
          <p>{$coauthor->description}</p>
        </div>
      </div>
      EOT;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to use function coauthors_get_avatar ?’ is closed to new replies.