Skip to content

Instantly share code, notes, and snippets.

@nroca
Created May 26, 2014 16:13
Show Gist options
  • Save nroca/bf978817bd02de6bd3e8 to your computer and use it in GitHub Desktop.
Save nroca/bf978817bd02de6bd3e8 to your computer and use it in GitHub Desktop.
Wordpress custom post type loop
<?php $cpt = new WP_Query('post_type=POSTTYPE&posts_per_page=-1');
while ($cpt->have_posts()) : $cpt->the_post();?>
<?php endwhile; wp_reset_query(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment