Support » Plugins » Future posts in Archives

  • Hi,

    please, how to make the future (scheduled) posts appear in the Archives in sidebar? I don’t mind adding line or two somewhere in the source code somewhere…

    Also, when I click on some “month year” link it should list the future posts for the respective month as well. (I’m just not sure whether this is separate query from the Archives query above, or not.)

    Thanks for any help in advance!

Viewing 2 replies - 1 through 2 (of 2 total)
  • I forgot to ask, is it possible to list future posts in category listings? Is it the same query, I mean same place in source code?

    Ok, this is what I have now, maybe I should write it down here for future reference. So far it works for me, if you have some issues or comment, please tell me…

    You have to patch two files:

    – in “general_template.php” there is “wp_get_archives()”:
    search for:
    $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status = 'publish'", $r );
    and replace it by:
    $where = apply_filters('getarchives_where', "WHERE post_type = 'post' AND post_status IN ('publish', 'future')", $r );
    this way, the future posts will appear in the Archives in sidebar

    – in “query.php” there is “&get_posts()”:
    if ( is_admin() )
    $where .= " OR $wpdb->posts.post_status = 'future' OR $wpdb->posts.post_status = 'draft' OR $wpdb->posts.post_status = 'pending'";
    elseif ( !is_front_page() )
    $where .= " OR $wpdb->posts.post_status = 'future'";
    and then do this, too:

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Future posts in Archives’ is closed to new replies.