Buzzslot, Web trends, internet strategy, design, blogging

How to: List of scheduled posts

category: Snippets | Tags: , .

Just a variation of the wordpress loop for this snippet. Pretty easy to implement. Just paste the following code anywhere in your template, where you want the list to be diplayed.

<?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();
        $do_not_duplicate = $post->ID; ?>
        <li><?php the_title(); ?></li>
    <?php endwhile;
}
?>

By changing this number “showposts=5″ you control how many posts you want to display.


Leave a Reply