I want to display my 2. latest post
-
20-04-2021 - |
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