Olga
0
Q:

wp_query custom post type

  <?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(); 
  ?>
0
//WordPress: Query a custom post type
//For example, query all Case Study post types

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

New to Communities?

Join the community