Quick tip – how to get specific posts/page by their ID?

At first look it was simple, just:

but, this way we can get ONLY posts, not pages. To get both posts AND pages just add:

in WP_Query arguments list so it will look like this:

And voila – we have both content types.

Leave a Reply