How to Exclude Latest Post from the WordPress Post Loop

Recently I made a News website there I have to run a query for all the posts except the latest post. WordPress have a cool solution for this.
When run WP_Query, just add this into your query argument. And it will work fine.


'offset'=1,

Here is an perfect example. You can use like this.


$args = array (
'post_type' => 'post',
'nopaging' => false,
'posts_per_page' => '3',
'category_name' => 'sports',
'order' => 'DESC',
'orderby' => 'ID',
'offset'=> 1
);

Hope it works. Thanks for you !

Leave a Reply

Your email address will not be published. Required fields are marked *