Elencare i post programmati
Da AldoWiki.
È possibile elencare i post che sono stati già scritti e programmati e quindi non ancora pubblicati. Per farlo si può usare questo loop:
<?php query_posts('showposts=10&post_status=future'); ?> <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <h2><?php the_title(); ?></h2> <span class="data"><?php the_time('j F Y'); ?></span> <?php endwhile; else: ?> <p>No future events scheduled.</p> <?php endif; ?>
Si chiederà a WordPress di cercare 10 post che siano nello stato di programmazione; se i post ci sono, essi verranno visualizzati, altrimenti verrà stampata una frase di avvertimento.
Fonte: Smashing Magazine.