1 <?php
2 $args = array(
3 'post_type' => 'custom_type',
4 'post_status' => 'publish',
5 'posts_per_page' => 8,
6 'orderby' => 'title',
7 'order' => 'ASC',
8 );
9
10 $loop = new WP_Query( $args );
11
12 while ( $loop->have_posts() ) : $loop->the_post();
13 print the_title();
14 the_excerpt();
15 endwhile;
16
17 wp_reset_postdata();
18 ?>
1//WordPress: Query a custom post type
2//For example, query all Case Study post types
3
4<?php query_posts('post_type=case_studies'); ?>