WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Display future regardless of date (7 posts)

  1. noelgreen
    Member
    Posted 6 years ago #

    Is there any way that I can make posts show no matter of the date they're posted?

    So posts I post today (in March) and give the date of July will go ahead and show now... instead of waiting until the day the entered in the time stamp.

    I know about the Event Calendar plug-in, but this doesn't do what I'm wanting. I just want posts to display even if they're in the "future".

  2. noelgreen
    Member
    Posted 6 years ago #

    This was an easy find / fix... just took some research.
    The easiest way to do this is with "The Future is Now" plgin-in.

  3. millik1
    Member
    Posted 6 years ago #

    This is how I display future dates from my 'Gigs' category, without resorting to plugins or modifying core WP code ...

    <?php
    $my_query = new WP_Query('category_name=gigs&post_status=future&order=ASC');
    while ($my_query->have_posts()) : $my_query->the_post();
    $do_not_duplicate = $post->ID;
    ?>

    Works in later versions of WP 2.xx.

    For full details ...

    http://www.keithmillington.co.uk/wordpress/?p=22

  4. vickilh2
    Member
    Posted 5 years ago #

    I don't think we'll be entering future events that we don't want displayed, so what I did is tweak the code in ../wp-includes/post.php:

    if ( 'publish' == $post_status ) {
                    $now = gmdate('Y-m-d H:i:59');
                    if ( mysql2date('U', $post_date_gmt) > mysql2date('U', $now) )
                    // changed so that future dates will be displayed
                    //      $post_status = 'future';
                            $post_status = 'publish';
            }

    Best, Vicki

  5. geofftswin
    Member
    Posted 5 years ago #

    How does the above work so that future posts are displayed, but once they are in the past they don't?

    I've tried Keith Millington's code, but it gives a 404 not found error when non-logged in users try to read the post :(

  6. tades
    Member
    Posted 5 years ago #

    I think it's not necesary modify the post file, the solution is in query.php file

    check this

  7. tades
    Member
    Posted 5 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic