Du musst dich anmelden um Beiträge und Themen zu erstellen. Einloggen · Registrieren

Display Posts Upcoming Scheduled Posts

Here’s an easy way to display a list of posts that are scheduled to be published at some point in the future. Create a page called “Upcoming Posts” (or whatever), and use this code for the loop:

<?php query_posts('showposts=7&post_status=future'); ?>

<?php if (have_posts()) : ?>

	<h3>Upcoming Scheduled Posts</h3>
	<?php while (have_posts()) : the_post(); ?>

		<li><?php the_title(); ?> &#8212; <?php the_time('l, F j, Y'); ?></li>

	<?php endwhile; ?>

<?php else: ?>

	<p>Nothing new in queue!</p>

<?php endif; ?>

In place, this code will output a list of all posts that exist within the database that have a post_status of “future”. I.e., anything that you have setup in draft mode that is set to auto-publish at a certain point in the future.