Geplante Artikel anzeigen

Möchtet ihr euren Lesern anzeigen auf welche Artikel diese sich in Zukunft freuen können, dann plaziert den Code-Schnipsel auf einer Seite oder in der Sidebar eures Blogs.

1
2
3
4
5
6
7
8
9
10
11
<?php query_posts('showposts=1&post_status=future'); ?>
<?php if (have_posts()) : ?>
    <h3>Geplante Artikel</h3>
    <ul>
    <?php while (have_posts()) : the_post(); ?>
        <li><?php the_title(); ?> - <?php the_time('d.m.Y'); ?></li>
    <?php endwhile; ?>
    </ul>
<?php else: ?>
    <p>Kein Artikel in Vorbereitung!</p>
<?php endif; ?>

Der Code erzeugt eine Liste aller Artikel, die in der Datenbank als Entwurf markiert sind. Die Anzahl der angezeigten Artikel kann über die Variable showposts verändert werden.