Skip to content

Instantly share code, notes, and snippets.

@juarezpaf
Created September 26, 2009 17:50
Show Gist options
  • Select an option

  • Save juarezpaf/194337 to your computer and use it in GitHub Desktop.

Select an option

Save juarezpaf/194337 to your computer and use it in GitHub Desktop.
// Simple Lists
function get_simple_list($category) {
global $post;
$posts = get_posts('numberposts=5&category='.$category);
$html = '<h1><a href="'. get_pretty_category_link($category) .'">'. get_cat_name($category) .'</a></h1>';
$html .= '<ul class="simple_list">';
foreach($posts as $post) :
setup_postdata($post);
$html .= '<li>';
$html .= '<a title="'. the_title('','',false) .'" href="'. get_permalink() .'" rel="bookmark">'. the_title('','',false) .'</a>';
$html .= '</li>';
endforeach;
$html .= '</ul>';
return $html;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment