• greencode

    (@greencode)


    I’m needing a way to display future posts in a custom query. I’m using “The Future is Now” plugin so I can display those posts on the site but I need to list the next 10 posts from today’s date.

    I’m currently using this but it doesn’t seem to be working correctly as I keep on having to increase the posts_per_page amount to show future posts.

    <ul class="list">
    
    <?php query_posts('cat=12&posts_per_page=10&orderby=date&order=ASC'); ?>
    <?php while ( have_posts() ) : the_post() ?> 
    
    <?php  //check the dates
    $post_date = mysql2date("Ymd", $post->post_date_gmt);
    $currentdate = date("Ymd", strtotime('-1 day'));
    $expirationdate = $post_date;
    if ( $expirationdate > $currentdate ) { ?>
    
        <li>
        <h4><a href="<?php the_permalink(); ?>"><?php the_title(); ?> &raquo;</a></h4>
        </li>
    
    	<?php } //end date check ?>
        <?php endwhile; ?>
    
    </ul>

    Any ideas or help would be greatly appreciated.

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