Home » Wordpress » WordPress get recent post except first 3 posts

WordPress get recent post except first 3 posts

How to check and get recent post 3 in wordpress? On another way it’s calling exclude posts.I’m going to explain this in 2 methods.First method is getting first 3 posts into an array. When we’re going to display the posts, checking current post ID if exist in that array. If exist continue the loop.If not exist then display the posts.Other method is passing parameter “offset”.

Method – 1

Method – 2

In here you can pass parameter “offset” to fetch post query as following.

This query is telling the loop to only display 5 posts which follow the most recent first post. The important part in this code is “offset” and this magic word is doing the whole thing.

Tags

Similar posts