WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom wordpress query like so:

$query = new WP_Query(array('post_status' => 'future || publish', 'post_type' => 'kalender', 'order' => 'ASC'));

But the problem is that the items shown on the pages also include the items that are in the trash? I don't understand why because according to the post_status only published & future posts should be shown?

The item in the trash is a post in the future though? Maybe that's why it's shown but how can I exclude that one?

share|improve this question
I assume you're trying to create an event calendar of sorts by using the publish date as the event date. if that's the case, you're better off storing the event date as post meta data rather than abusing the publish date for this purpose. – Milo Mar 27 '13 at 17:22
@Milo Thank you for your suggestion, I understand your reasoning, I'll change it soon! – user2019515 Mar 27 '13 at 17:26
up vote 2 down vote accepted

The syntax in the query above is wrong, it should be:

$query = new WP_Query(array('post_status' => array( 'publish', 'future' ), 'post_type' => 'kalender', 'order' => 'ASC'));

That seems to solve the problem. :)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.