Home » Labs » How to display future posts in WordPress  

How to display future posts in WordPress


Filed under Labs

Including future posts in a WordPress loop is quite easy with the usage of simple query_posts with some arguments. Below is a working code which will display the future posts on WordPress site. Just copy and paste it on the template where you want to show future posts.

 
	<?php query_posts('showposts=5&post_status=future'); ?>
	<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
 
		<div class="future-posts">
			<p class><b><?php the_title(); ?></b><?php edit_post_link('e',' (',')'); ?><br>
			<span class="datetime"><?php the_time('j. F Y'); ?></span></p>
		</div>
 
	<?php endwhile; else: ?><p>No future posts.</p><?php endif; ?>
It's only fair to share...Share on Google+Tweet about this on TwitterShare on Facebook

Posts you may like: