Support » Themes and Templates » Show today and future posts

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    leave the functions code in functions.php;
    but remove this line from functions.php:

    add_filter( 'posts_where', 'my_posts_where_from_today' );

    and add it before your ‘query_posts()’ line; i.e.

    add_filter( 'posts_where', 'my_posts_where_from_today' );
    <?php query_posts( array( 'category_name' => 'games', 'post_status' => 'future || publish', 'post_type' => 'post', 'post_per_page' => '15', 'orderby' => 'date', 'order' => 'ASC' ) ); ?>

    then, after the ‘endwhile’ line, add:

    remove_filter( 'posts_where', 'my_posts_where_from_today' );

    Thanks!
    I tried the first part but forgot to put the remove_filter afterwards 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show today and future posts’ is closed to new replies.