I want to hide the WordPress post from archives page using the 'private' option. I only want the post to be hidden from archives but visible to public. How to I do it?
You'll want to filter the main query via
If you'll only want to handle one specific post in this manner, you can reference/exclude its post ID directly. If, however, you want this same behavior for any future private posts, then I would query all posts with
One post (where ID = 123):
Or, for all
I think the easiest way would be to control the loop in the
Where 7 is the post_ID of the post you want to hide and the
Take a look at this link that explains the usage and arguments that can be passed, in case you want to go further then what your question suggests.
--- Update ---
Given toscho's comments I've dug around a bit and here is how you can use a filter on the