Guest User

Untitled

a guest
Aug 11th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. $buffy .= '<span class="tdb-author-by">' . $this->get_att( 'author_by' ) . '</span> ';
  2. global $wp;
  3. $post_name = $wp->request;
  4. $post_id = $post_ids = get_posts(array
  5. (
  6. 'post_name' => $post_name,
  7. 'post_type' => $post_type,
  8. 'numberposts' => 1,
  9. 'fields' => 'ids'
  10. ));
  11. // var_dump($post_id);
  12. $coauths = get_coauthors($post_id[0].ID);
  13. if (count($coauths) > 1) {
  14. foreach ($coauths as $key => $coauth) {
  15. $buffy .= '<a class="tdb-author-name " href="/author/' . $coauth->user_nicename . '">'. $coauth->display_name . '</a>';
  16. if (($key + 1) != count($coauths)) {
  17. $buffy .= '&nbsp;and&nbsp;';
  18. }
  19. }
  20. }
  21. else {
  22. $buffy .= '<a class="tdb-author-name" href="' . $post_author_data['author_url'] . '">' . $post_author_data['author_name'] . '</a>';
  23. };
Advertisement
Add Comment
Please, Sign In to add comment