johannesress
2/8/2014 - 7:32 AM

Looping through posts of custom post type

Looping through posts of custom post type

<?php
  // Query for Post Type
  $args = array( 'post_type' => 'post-type-name', 'posts_per_page' => 4, 'orderby' => 'menu_order/rand', 'order' => 'ASC' );
  
  $myposts = get_posts( $args );
  foreach ( $myposts as $post ) : setup_postdata( $post ); ?>
  
  <!-- Insert Template Code here! -->
  
  <?php endforeach; 
wp_reset_postdata();?>