Untitled Snippet
// WP_Query arguments $args = array( 'posts_per_page' => '10', 'order' => 'DESC', 'orderby' => 'id', ); // The Query $query_work = new WP_Query( $args ); // The Loop if ( $query_work->have_posts() ) { while ( $query_work->have_posts() ) { $query_work->the_post(); // do something } } else { // no posts found } // Restore original Post Data wp_reset_postdata();