Home › Forums › Back End › How to 'query' a Custom Post Type › Reply To: How to 'query' a Custom Post Type
December 2, 2013 at 8:24 am
#157578
Participant
A very simple query for a custom post type would be something like this:
$custquery = new WP_query (
array(
'post_type'=> 'speakers',
'posts_per_page' => 5
)
);
while ( $custquery -> have_posts() ) : $custquery -> the_post();
echo the_title();
echo the_content();
endwhile;
wp_reset_query();