0

enter image description hereHi,

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

  • How are you adding these posts? As a widget, in a template, in your header or footer files? – Tony Djukic May 13 at 16:46
1

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;  

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.