Display a List of Upcoming Posts in WordPress

wordpress-logo-shineWhen you have completed a post in WordPress, you have the ability to save it as a draft, publish it immediately or schedule a future date when it will be published automatically. This is extremely helpful if you want to plan ahead or if you use your WP site for events. Creating a simple list of upcoming posts lets your visitors know what they can look forward to and is pretty simple to do.

The following code can be placed in your sidebar on within any template.

query('showposts=5&post_status=future&order=ASC');
if ($futurePosts->have_posts()) : while ($futurePosts->have_posts()) :
?>

  • No upcoming events.

If you want to only display future posts from a specific category, you can add a cat=$id to the query like so:

$futurePosts->query('showposts=5&post_status=future&order=ASC&cat=12');

Be sure to change the “12” to the category ID.

Share this:

Email
Facebook
Twitter
Pinterest
Pocket

Premium Themes for WordPress

Looking for an easy-to-use Premium Theme for WordPress? Check out Themes by bavotasan.com and have your site up and running in no time.

Use this WordPress website builder to build powerful websites in no time for your or your clients.

WordPress Hosting

WP Engine – designed from the ground-up to support and enhance the workflow of web designers.

Bluehost – providing quality web hosting solutions since 1996.

About the author

Picture of Luke Perrie

Luke Perrie