List future posts


List future posts

11 Mai 2013, Posted by antoine in

WordPress allows listing future posts, and to achieve this feature, simply paste the code to wherever you’d like you future posts to be displayed:

<div id="zukunft">
    <div id="zukunft_header"><p>Future events</p></div>
    <?php query_posts('showposts=10&post_status=future'); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

        <p><strong><?php the_title(); ?></strong><?php edit_post_link('e',' (',')'); ?><br />
        <span><?php the_time('j. F Y'); ?></span></p>
    <?php endwhile; else: ?><p>No future events scheduled.</p><?php endif; ?>