Skip to content

Instantly share code, notes, and snippets.

@kachi
Created March 11, 2012 04:46
Show Gist options
  • Select an option

  • Save kachi/2015074 to your computer and use it in GitHub Desktop.

Select an option

Save kachi/2015074 to your computer and use it in GitHub Desktop.
<?php
query_posts('showposts=5&category_name=foo');
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
<?php the_content(); ?>
<?php
endwhile; else:
// No posts.
endif;
wp_reset_query();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment