List wordpress future posts

February 22, 2009 · Print This Article

Do you ever wished to be able to use WordPress to list future events?

This can be very useful for exemple if you’re using WordPress for a band website and like to list your future shows.

Just simply paste this code where you’d like you future posts to be displayed:


<div id="livexpft">
<div id="livexpft_header"><p>Future events</p></div>
<?php query_posts('showposts=10&post_status=future'); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div >
<p class><b><?php the_title(); ?></b><?php edit_post_link('e',' (',')'); ?><br />
<span class="datetime"><?php the_time('j. F Y'); ?></span></p>
<?php endwhile; else: ?><p>No future events scheduled.</p><?php endif; ?>

Your choice for site templates and wordpress themes


Got something to say?

You must be logged in to post a comment.