Title: Query Tomorrow&#039;s Posts
Last modified: August 19, 2016

---

# Query Tomorrow's Posts

 *  Resolved [Joe Mac415](https://wordpress.org/support/users/joe-mac415/)
 * (@joe-mac415)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/query-tomorrows-posts/)
 * Hello,
 * I am looking to query tomorrow’s posts stored in the client’s system. I can easily
   pull up the future posts using this:
 *     ```
       <?php
   
         function filter_where($where = '') {
   
           $where .= " AND post_date >= DATE( NOW() )";
   
           return $where;
   
         }
   
       	add_filter('posts_where', 'filter_where');
   
       	$my_query = new WP_Query( 
   
       		array( 
   
       			'post_type'=>'post', 
   
       			'orderby' => 'date',
   
       			'order' => 'DESC', 
   
       			'cat' =>348, 
   
       			'post_status' => 'future',
   
       			)
   
       		);
   
       	while ( $my_query->have_posts() ) :
   
       		$my_query->the_post();
   
       		$do_not_duplicate = $post->ID;
   
       ?>
   
       <p> <?php the_date(); ?></p> 
   
       <p><strong><?php $value = get_post_meta($post->ID, 'tba', true);
   
       	if($value == 'true') { ?>TBA<?php } else {the_time('g:i a');}; ?> - <a href="<?php echo get_post_meta($post->ID, "event_url", true); ?>"><?php the_title() ?></a></strong> 
   
       <?php 
   
       	endwhile;  
   
       remove_filter('posts_where', 'filter_where');
   
       ?>
       ```
   
 * But I just want to have it post the next day’s posts and the next week’s. Can
   anyone help?

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

 *  Thread Starter [Joe Mac415](https://wordpress.org/support/users/joe-mac415/)
 * (@joe-mac415)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/query-tomorrows-posts/#post-1615635)
 * Any help on this? I am on deadline here.
 *  Thread Starter [Joe Mac415](https://wordpress.org/support/users/joe-mac415/)
 * (@joe-mac415)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/query-tomorrows-posts/#post-1615651)
 * Ok I got it. If anyone is wondering, you need to create $where between the two
   dates:
 *     ```
       $where .= " AND post_date >= '" . date('Y-m-d', strtotime('+1 day')) . "'" . " AND post_date <= '" . date('Y-m-d', strtotime('+7 days')) . "'";
       ```
   
 * And it works.

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

The topic ‘Query Tomorrow's Posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [Joe Mac415](https://wordpress.org/support/users/joe-mac415/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/query-tomorrows-posts/#post-1615651)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
