Skip to content

Instantly share code, notes, and snippets.

@cphilippsen
Created October 22, 2012 07:44
Show Gist options
  • Save cphilippsen/3930169 to your computer and use it in GitHub Desktop.
Save cphilippsen/3930169 to your computer and use it in GitHub Desktop.
WP_Query loop with Custom Post Type
$movies = new WP_Query(
array(
'post_type' => 'movie_reviews',
'order' => 'DESC',
'orderby' => 'date'
)
);
<?php while ( $movies->have_posts() ) : $movies->the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
... etc ...
<?php endwhile; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment