Post Pic

How to: List future posts

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.

To achieve this recipe, simply paste this code where 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(); ?>
		<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>

Related Posts

Related Posts

No related posts.

41 Responses

Feb 21 2009 18:22

There is a WordPress plugin which incorporate this feature, Upcoming Post. Check out my post for more information about showing future post without touching PHP code.

Feb 21 2009 18:24

The answer is yes. I want to list the future post, so people will be eager to read it. I have always wanted to do so.

Thanks for this tip. It will be helpful for my new upcoming blog.

Feb 21 2009 20:07

What I need is a way to incorporate this in the admin dashboard of our multi author blog. Can I maybe modify one of the standard elements that I do not use?

Feb 21 2009 22:40

Well, I added the code into a sidebar and it didn’t work. While I do have a few upcoming posts it showed nothing.

Your tip about highlighting author comments didn’t work for me either. And yes, I am using WP 2.7

Feb 22 2009 18:06

thanks :)

Feb 22 2009 23:48

thank you for this nice information.

Feb 26 2009 14:22

The answer is yes. I want to list the future post, so people will be eager to read it.

Mar 02 2009 11:52

This is great. I wandered here by accident I think I’ll stay. I haven’t reead past the first couple posts but I’ve already found so many useful information – I could certainly use the list like that for listing my upcoming reviews. Keep up the good work.

Mar 08 2009 07:37

Nice post. Every time I read this blog I realize more how useful is it.

Mar 16 2009 00:28

thank you vety much for this useful information.

May 23 2009 02:49

thanks bro ..very useful !

Jan 14 2010 17:45

Hey,

I want to use this code to display a list of forthcoming gigs, but with the ability for users to view the full post, not just the title. I’ve added a link to the post, but this only works for admins, non admins just get a 404 page. Is there any way non admins can view unpublished post?

Thanks
Jon

Feb 10 2010 15:49

thank you for the code – like it =)

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required