Skip to content

Instantly share code, notes, and snippets.

@zenman
Created December 30, 2013 22:11
Show Gist options
  • Save zenman/8189096 to your computer and use it in GitHub Desktop.
Save zenman/8189096 to your computer and use it in GitHub Desktop.
<?php $the_query = new WP_Query('cat=3&posts_per_page=2'); ?>
<?php if ($the_query->have_posts()) : ?>
<?php while ($the_query->have_posts()) : $the_query->the_post(); ?>
output...
<?php endwhile; wp_reset_postdata();?>
<?php endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment