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'd like my archive.php page's daily view (is_day) to display scheduled posts (post_status=future). For example, if I go to mysite.com/2011/05/20 I would see all posts scheduled to appear on May 20.

The archive page's loop starts with:

if ( have_posts() )

and ends with:

get_template_part( 'loop', 'archive' );

Do I need to make a second loop, or can I modify this single loop to show scheduled posts? If so, how? Thank you.

share|improve this question
up vote 6 down vote accepted

Keep things simple - leave your archive templates alone and place this in your functions.php;

if ( !is_admin() ) :
function __include_future( $query )
    if ( $query->is_date() || $query->is_single() )
        $GLOBALS[ 'wp_post_statuses' ][ 'future' ]->public = true;
add_filter( 'pre_get_posts', '__include_future' );

Essentially, it says;

If we're on a date archive, or viewing a single post, make future posts publicly visible.

As a result, WordPress behaves normally when you view archives for any given date, except now it also includes posts 'from the future'!.

share|improve this answer
You're a genius - thank you! – Ryan May 9 '11 at 21:46
I found this to be the most elegant of several solutions I found, thanks! – Kevin C. Mar 25 '13 at 18:13

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.