wp_query get custom post type
snippet in php

wp_query get custom post type

user9614

  <?php    
  	   $args = array(  
      'post_type' => 'custom_type',
      'post_status' => 'publish',
      'posts_per_page' => 8, 
      'orderby' => 'title', 
      'order' => 'ASC', 
          );

  $loop = new WP_Query( $args ); 

  while ( $loop->have_posts() ) : $loop->the_post(); 
      print the_title(); 
      the_excerpt(); 
  endwhile;

  wp_reset_postdata(); 
  ?>

wp_query custom post type

user8425

//WordPress: Query a custom post type
//For example, query all Case Study post types

<?php query_posts('post_type=case_studies'); ?>