List Your Upcoming Posts


A sure way to bring readers back to your blog is to tell them what is coming up for release. This is an especially useful feature if you use the post scheduling feature in WordPress. While there are probably plugins that will do this for you, all you actually need is this code snippet. You can just copy and paste it into one of your theme files where you want the list to appear - e.g. the sidebar.

WARNING: Do not do this if you are not comfortable altering the files in your theme. Make sure you make a back up of the file that you are going to change before making the change.

<div id=“crystal_ball”>
<div id=“crystal_ball_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>
</div>
<?php endwhile; else: ?><p>No future events scheduled.</p><?php endif; ?>
</div>

This willl produce a list of posts that are marked Future. If you want to show less or more than 10 upcoming posts just change the number in the line “ <?php query_posts(’showposts=10&post_status=future’); ?> ” to the number of posts you want to display.

Its as easy as that.

Reblog this post [with Zemanta]

Popularity: 2% [?]

, ,



This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

  1. #1 by Best CSS Gallery on June 11, 2009 - 8:10 pm

    Thanks for sharing this, I never knew about this way of announcing upcoming posts

  2. #2 by PSP Go on November 29, 2009 - 1:07 pm

    I hadn't thought of doing this, it is a great idea to have a little teaser.

  3. #3 by Hipolito M. Wiseman on December 26, 2009 - 5:39 am

    Hi buddy, your blog's design is simple and clean and i like it. Your blog posts are superb. Please keep them coming. Greets!!!

(will not be published)



    Fatal error: Call to undefined function wp_list_comments() in /usr/www/users/tambor2/sly/wordpress/wp-content/themes/fusion/comments.php on line 158