There are several plugins for that:
https://ww.wp.xz.cn/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');
Thank you very much, you made my saturday night 😉 – the Plugin works good!