2

Is there a way to display posts, scheduled for the future?

I want to use the published data as an event date and time, which is obviously in the future. I still would like to use these posts for a loop, and for single pages.

2
    $args = array(
    'post_status' => "future",
    'order_by' => 'date',
    'order' => 'ASC'
     );
$yourLoop = new WP_Query($args);
0

Use

  • 'post_status' => 'draft' to receive all posts that are not published.
  • 'order' => 'DESC' to sort from highest (first) value to the lowest
  • 'orderby' => 'date' to sort by post date

Get

then compare if the post is in the future and - if so - display it.

Maybe there are easier ways to do this, but this is the fastest guide to a solution I could come up with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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