Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. [catlist template=lcp_template_1]
  2.  
  3. <?php
  4. /*
  5. Plugin Info & license stuff...
  6. */
  7. $lcp_output = '';
  8. //Show category?
  9. if ($atts['catlink'] == 'yes'){
  10. $cat_link = get_category_link($lcp_category_id);
  11. $cat_title = get_cat_name($lcp_category_id);
  12. $lcp_output = '<div class="topic-heading"><a href="' . $cat_link . '" title="' . $cat_title . '">' . $cat_title . '</a></div>';
  13. }
  14. $lcp_output .= '<div class="post">';//For default ul
  15.  
  16. //Posts loop:
  17.  
  18. foreach($catposts as $single):
  19. $lcp_output .= '<h2 class="entry-title"><a href="' . get_permalink($single->ID) . '">' . $single->post_title . '</a></h2>';
  20. //Show comments?
  21. if($atts['comments'] == yes){
  22. $lcp_output .= ' (' . $single->comment_count . ')';
  23. }
  24. //Style for date:
  25. if($atts['date']=='yes'){
  26. $lcp_output .= ' <div class="entry-meta"> ' . get_the_time($atts['dateformat'], $single) . '</div>';
  27. }
  28. //Show author?
  29. if($atts['author']=='yes'){
  30. $lcp_userdata = get_userdata($single->post_author);
  31. $lcp_output .=' <div class="entry-meta">' .$lcp_userdata->display_name . '</div>';
  32. }
  33. //Show thumbnail?
  34. if($atts['thumbnail']=='yes'){
  35. $lcp_output .= '<div class="lcp_thumbnail"><a href="' . get_permalink($single->ID) . '">' . get_the_post_thumbnail($single->ID, array('40','40')) .'</a></div>';
  36. }
  37.  
  38. //Show content?
  39. if($atts['content']=='yes' && $single->post_content){
  40. $lcpcontent = apply_filters('the_content', $single->post_content); // added to parse shortcodes
  41. $lcpcontent = str_replace(']]>', ']]&gt', $lcpcontent); // added to parse shortcodes
  42. $lcp_output .= '<p>' . $lcpcontent . '</p>'; // line tweaked to output filtered content
  43. }
  44. //Show excerpt?
  45. if($atts['excerpt']=='yes' && !($atts['content']=='yes' && $single->post_content) ){
  46. $lcp_output .= lcp_excerpt($single);
  47. }
  48. endforeach;
  49. $lcp_output .= '</div>';
  50. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement