Title: show future posts
Last modified: August 31, 2016

---

# show future posts

 *  Resolved [mlinhuberin](https://wordpress.org/support/users/mlinhuberin/)
 * (@mlinhuberin)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/show-future-posts-2/)
 * Hi there,
 * in my site the some posts are used to announce future events. The post datum 
   is the vent datum. I show the posts at the front page and in the archive using
 * `$the_query = new WP_Query('showposts=-1&post_type=post&post_status=future,publish&
   orderby=date&order=ASC&cat='.$cat);`
 * But if I choose a future post to show the details I become a 404. I tried
    `$
   the_query = new WP_Query( 'post_status=future,publish' );` but then all posts
   in the categorie are shown.
 * where is my mistake?
 * Thank you
    Marion

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

 *  Theme Author [Tomas Mackevicius](https://wordpress.org/support/users/tomasm/)
 * (@tomasm)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/show-future-posts-2/#post-7035696)
 * There are several plugins for that:
 * [https://wordpress.org/plugins/future/](https://wordpress.org/plugins/future/)
 * In one of my project I was using this hard coded solution. It was based on Twenty
   Ten theme. In index.php I modified loop to:
 *     ```
       <div id="container">
   
       			<div id="content" role="main">
   
       						<!-- Constructing new custom LOOP outside the main LOOP -->
   
       						<?php /* Adding filter to show posts for today and future */ ?>
       						<?php add_filter( 'posts_where', 'my_posts_where_from_today' ); ?>
   
       						<?php query_posts( array( 'category_name' => 'naujienos', 'post_status' => 'future || publish', 'post_type' => 'post', 'post_per_page' => '15', 'orderby' => 'date', 'order' => 'ASC' ) ); ?>
       						<?php while ( have_posts() ) : the_post(); ?>
   
       						<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
       						<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
   
       [...]
       ```
   
 * Then this functions goes to functions.php:
 *     ```
       //Show posts for today and future
       function my_posts_where_from_today( $where = '' ) {
       	$where .= " AND post_date > '" . date('Y-m-d', strtotime('now')) . "'";
       	return $where;
       }
   
       /* Show future posts on single posts and pages*/
       function show_future_posts($posts)
       {
          global $wp_query, $wpdb;
          if(is_single() && $wp_query->post_count == 0)
          {
             $posts = $wpdb->get_results($wp_query->request);
          }
          return $posts;
       }
       add_filter('the_posts', 'show_future_posts');
       ```
   
 *  Thread Starter [mlinhuberin](https://wordpress.org/support/users/mlinhuberin/)
 * (@mlinhuberin)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/show-future-posts-2/#post-7035745)
 * Thank you very much, you made my saturday night 😉 – the Plugin works good!

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

The topic ‘show future posts’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/tiny-framework/2.3.1/screenshot.
   png)
 * Tiny Framework
 * [Support Threads](https://wordpress.org/support/theme/tiny-framework/)
 * [Active Topics](https://wordpress.org/support/theme/tiny-framework/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/tiny-framework/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/tiny-framework/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [mlinhuberin](https://wordpress.org/support/users/mlinhuberin/)
 * Last activity: [10 years, 4 months ago](https://wordpress.org/support/topic/show-future-posts-2/#post-7035745)
 * Status: resolved