WordPress.org

Forums

Future posts in Archives (3 posts)

  1. Ecir Hana
    Member
    Posted 6 years ago #

    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!

  2. Ecir Hana
    Member
    Posted 6 years ago #

    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?

  3. Ecir Hana
    Member
    Posted 6 years ago #

    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()":
    after:
    if ( is_admin() )
    $where .= " OR $wpdb->posts.post_status = 'future' OR $wpdb->posts.post_status = 'draft' OR $wpdb->posts.post_status = 'pending'";
    add:
    elseif ( !is_front_page() )
    $where .= " OR $wpdb->posts.post_status = 'future'";
    and then do this, too:
    http://wordpress.org/support/topic/141099?replies=2

Topic Closed

This topic has been closed to new replies.

About this Topic