Portfolio Items Custom Post Type Query
WP_Querying our custom post type. Returns all published portfolio items by date, in descending order.
// WP_Query arguments $args = array( 'post_type' => array( 'portfolio_items' ), 'post_status' => array( 'publish' ), 'has_password' => false, 'nopaging' => false, 'posts_per_page' => '6', 'posts_per_archive_page' => '24', 'ignore_sticky_posts' => false, 'order' => 'DESC', 'orderby' => 'date', ); // The Query $portfolio_items_query = new WP_Query( $args ); // The Loop if ( $portfolio_items_query->have_posts() ) { while ( $portfolio_items_query->have_posts() ) { $portfolio_items_query->the_post(); // do something } } else { // no posts found } // Restore original Post Data wp_reset_postdata();