Ok so I want to be able to filter posts through a function.
I suppose I need a Action Hook that is after the posts are loaded, but before anything is displayed (as I may set cookies)
So I am using the action hook "init", which "Runs after WordPress has finished loading but before any headers are sent"
My questions are:
-is this the right action hook to use?
-how can I access wp's loaded posts. For example I would like to loop through all posts and (for example) check if each post is in category X. If it is, I would like to remove it from wp's loaded posts.
And so by doing this in my plugin, it is my belief that WP should only loop through the remaining posts once it gets into "The Loop". Am I doing this right? Please help me and answer my questions, I have been desperately struggling with this for the past week, and I really appreciate any help. Thanks