|
| 1 | +<?php |
| 2 | + |
| 3 | +if ( class_exists( 'coauthors_plus' ) ) { // Get the Co-Authors for the post |
| 4 | + $co_authors = get_coauthors(); |
| 5 | +} else { |
| 6 | + $co_authors = array(); |
| 7 | +} |
| 8 | +echo '<div class="entry-author">'; |
| 9 | + echo '<div class="author-image">'; |
| 10 | + $author_bio_avatar_size = apply_filters( 'cc_author_bio_avatar_size', 50 ); |
| 11 | + if (count($co_authors)){ |
| 12 | + foreach ($co_authors as $an_author){ |
| 13 | + if ($an_author->type == 'guest-author') { |
| 14 | + echo get_avatar( get_the_author_meta( 'user_email', $an_author->ID ), $author_bio_avatar_size ); |
| 15 | + } else { |
| 16 | + echo '<a href="' . get_author_posts_url(get_the_author_meta( 'ID', $an_author->ID ), get_the_author_meta( 'user_nicename', $an_author->ID )) . '">' . get_avatar( get_the_author_meta( 'user_email', $an_author->ID ), $author_bio_avatar_size ) . '</a>'; |
| 17 | + } |
| 18 | + } |
| 19 | + } else { |
| 20 | + echo '<a href="' . get_author_posts_url(get_the_author_meta( 'ID' ), get_the_author_meta( 'user_nicename' )) . '">' . get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size ) . '</a>'; |
| 21 | + } |
| 22 | + echo '</div>'; |
| 23 | + echo '<div class="author-info-group">'; |
| 24 | + echo '<div class="author-name">'; |
| 25 | + if ( function_exists( 'coauthors_posts_links' ) ) { |
| 26 | + if (count($co_authors)){ |
| 27 | + $x = 1; |
| 28 | + foreach ($co_authors as $an_author){ |
| 29 | + if ($an_author->type == 'guest-author') { |
| 30 | + echo $an_author->display_name; |
| 31 | + } else { |
| 32 | + echo '<a href="' . get_author_posts_url($an_author->ID, $an_author->user_nicename) . '">' . $an_author->display_name . '</a>'; |
| 33 | + } |
| 34 | + if ($x != count($co_authors)) { echo ' and '; } |
| 35 | + $x++; |
| 36 | + } |
| 37 | + } |
| 38 | + } else { |
| 39 | + the_author_posts_link(); |
| 40 | + } |
| 41 | + echo '</div>'; |
| 42 | + echo '<div class="author-date">'. get_the_date( CC_Site::get_date_format() ); '</div>'; |
| 43 | + echo '</div>'; |
| 44 | +echo '</div>'; |
| 45 | +echo '</div>'; |
0 commit comments