Show 10 posts with most comments
// WP_Query arguments $args = array ( 'post_type' => 'post', 'posts_per_page' => '10', 'order' => 'DESC', 'orderby' => 'comment_count', ); // The Query $queryn2 = new WP_Query( $args ); // The Loop if ( $queryn2->have_posts() ) { while ( $queryn2->have_posts() ) { $queryn2->the_post(); // do something } } else { // no posts found } // Restore original Post Data wp_reset_postdata();