Skip to content

Instantly share code, notes, and snippets.

Created June 11, 2010 14:32
Show Gist options
  • Save anonymous/434539 to your computer and use it in GitHub Desktop.
Save anonymous/434539 to your computer and use it in GitHub Desktop.
<?php
//Show category?
if ($cat_link_string != ''){
$output = '<p><strong>' . $cat_link_string . '</strong></p>';
}else{
$output = '';
}
$output .= '<ul class="lcp_catlist">';//For default ul
//Posts loop:
foreach($catposts as $single):
$output .= '<li><img src="' . get_post_meta($single->ID, "image1", true) . '" /><a href="' . get_permalink($single->ID) . '">' . $single->post_title . '</a>';
//Style for date:
if($atts['date']=='yes'){
$output.= ' - ' . get_the_time($atts['dateformat'], $single);
}
//Show author?
if($atts['author']=='yes'){
$lcp_userdata = get_userdata($single->post_author);
$output.=" - ".$lcp_userdata->display_name;
}
//Show content?
if($atts['content']=='yes' && $single->post_content){
$lcpcontent = apply_filters('the_content', $single->post_content); // added to parse shortcodes
$lcpcontent = str_replace(']]>', ']]&gt', $lcpcontent); // added to parse shortcodes
$output.= '<p>' . $lcpcontent . '</p>'; // line tweaked to output filtered content
}
//Show excerpt?
if($atts['excerpt']=='yes' && $single->post_excerpt && !($atts['content']=='yes' && $single->post_content) ){
$output .= '<p>' . $single->post_excerpt . '</p>';
}
$output.='</li>';
endforeach;
$output.='</ul>';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment