Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (td_util::get_option('tds_p_show_author_name') != 'hide') {
- $coauths = get_coauthors();
- if (count($coauths) == '2') {
- echo "<div class=\"td-post-author-name\">By ";
- foreach ($coauths as $key => $coauth) {
- echo '<a href="/author/' . $coauth->user_nicename . '">' . $coauth->display_name . '</a>';
- // add "and"
- if ($key == count($coauths) - 2) {
- echo 'and ';
- $coauths = substr($coauthsHTML, 0, -2);
- }
- }
- echo ' - </div> ';
- }
- elseif (count($coauths) == 3 || count($coauths) == 4) {
- echo "<div class=\"td-post-author-name\">By ";
- foreach ($coauths as $key => $coauth) {
- echo '<a href="/author/' . $coauth->user_nicename . '">' . $coauth->display_name . '</a>';
- // add "and"
- if ($key == count($coauths) - 4) {
- echo ', ';}
- if ($key == count($coauths) - 3) {
- echo ', ';}
- if ($key == count($coauths) - 2) {
- echo ', and ';
- $coauths = substr($coauthsHTML, 0, -4);
- }
- }
- echo ' - </div> ';
- }
- else {
- echo $td_mod_single->get_author();
- };
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment