WordPress display future / upcoming posts

Home » Blog » WordPress display future / upcoming posts

Following code will display 5 future posts which are scheduled.
Code contains parameter called post_status. post status in this case is ‘future’ other than this post_status can be ‘draft’, ‘published’ and so on.

Simply add following code in you sidebar.php or anywhere you want to display future posts.

<h2>Future Posts</h2>
<ul>
<?php query_posts('showposts=5&post_status=future'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li><?php the_title(); ?><span class="date"><?php the_time('j. F Y'); ?></span></li>
<?php endwhile;
else: ?><li>No future Posts.</li>
<?php endif; ?>
</ul>
Tags: ,

3 Comments on "WordPress display future / upcoming posts"

  1. Vixka Studio says:

    Thank you for your useful article. It help me right now!

    Reply →
  2. Clare says:

    Worked a treat!

    Reply →
  3. mnrtjeR says:

    Nice post, comes in handy for me thanks!

    Reply →

Got something to say? Go for it!

CommentLuv badge

Pro Social Toolbar http://t.co/aFplIi36 via @daddydesign - 1 week ago

 
Pro Social Toolbar http://t.co/aFplIi36 via @daddydesign1 week ago