Skip to content

Displaying Scheduled (Upcoming) Posts in WordPress

If you like to schedule posts ahead of time (especially on the podcast), there’s a way to show your readers what posts are coming up next:

<h2>Upcoming Posts:</h2><?php
$my_query = new WP_Query('post_status=future
&order=DESC&showposts=5');
if ($my_query->have_posts()) {
while ($my_query->have_posts()) :
$my_query->the_post(); ?>
<?php the_date(); ?> -
<?php the_title(); ?>
<?php endwhile; } ?>

This will display up to 5 “scheduled” posts wherever you drop in the code.

So, who can use this?  Podcasters love this flexibility because it allows you to preview show topics before they happen.  Bloggers even love it because of the ability to show readers exactly what to expect.

Leave a Reply

Your email address will not be published. Required fields are marked *