Skip to content

Instantly share code, notes, and snippets.

@robertcedwards
Created May 15, 2013 23:51
Show Gist options
  • Save robertcedwards/5588385 to your computer and use it in GitHub Desktop.
Save robertcedwards/5588385 to your computer and use it in GitHub Desktop.
Querying by Post Type
$args = array( 'post_type' => 'product', 'posts_per_page' => 10 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
the_title();
echo '<div class="entry-content">';
the_content();
echo '</div>';
endwhile;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment