Guest User

Untitled

a guest
Apr 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. if ($author_posts) {
  2. echo '<ul>';
  3. $i = 0;
  4. foreach ($author_posts as $author_post) {
  5. /* excluded categories */
  6. if (has_category(explode(',', $atts['exclude']), $author_post->ID)) :
  7. continue;
  8. endif;
  9. $postdate = date_i18n( get_option( 'date_format' ), strtotime($author_post->post_date)).' - ';
  10. echo '<li>';
  11. echo ($atts['postdate'] ? $postdate : ''). '<a href="' . get_permalink( $author_post->ID ) . '">'.$author_post->post_title.'</a>';
  12. $categories = get_the_category( $author_post->ID );
  13. $list_cats =null;
  14. foreach ($categories as $cat) :
  15. $list_cats .= $cat->name.", ";
  16. endforeach;
  17. $list_cats = substr($list_cats, 0, -2);
  18. echo "<p>" .get_the_tags($author_post). "</p>";
  19. echo '</li>';
  20. $i++;
  21. if ($atts['postsperauthor'] > -1) :
  22. if ($i >= $atts['postsperauthor']) :
  23. break;
  24. endif;
  25. endif;
  26. }
  27. }
Add Comment
Please, Sign In to add comment