Question

enter image description hereHi,

Does anybody know a plugin or a way to show not the latest but the 2. and 3. latest post.

Was it helpful?

Solution

Try below code: It will display the second and third latest posts.

$the_query = new WP_Query(array( 'post_type' => 'post',
'post_status' => 'publish',
'order' => 'DESC',
'posts_per_page' =>'2',
'offset' => 1
));


if ( $the_query->have_posts() ) : 
   while ( $the_query->have_posts() ) : $the_query->the_post(); 

     the_title(); 
     the_excerpt();

   endwhile; 
  wp_reset_postdata(); 

else : 
     __('No post found');
endif;  

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top