Guest User

Untitled

a guest
Jan 8th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. //$show_stars_on_review - not used
  2. function get_author() {
  3. $buffy = '';
  4. $post_cat = get_the_category();
  5. $excl_cat = array("CATEGORY1", "CATEGORY2", "CATEGORY3", "CATEGORY3");// change example categories to post categories that shouldn't display the author name
  6. if (td_util::get_option('tds_p_show_author_name') != 'hide' && !in_array($post_cat[0]->cat_name, $excl_cat)) {// this checks if the category of the post is equal to one of the categories stored in array $excl_cat in line above
  7. $buffy .= '<div class="td-post-author-name">' . __td('By') . ' ';
  8. $buffy .= '<a itemprop="author" href="' . get_author_posts_url($this->post->post_author) . '">' . get_the_author_meta('display_name', $this->post->post_author) . '</a>' ;
  9.  
  10. if (td_util::get_option('tds_p_show_author_name') != 'hide' and td_util::get_option('tds_p_show_date') != 'hide') {
  11. $buffy .= ' - ';
  12. }
  13. $buffy .= '</div>';
  14. }
  15. return $buffy;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment