WordPress.org

Support

Support » Plugins and Hacks » Upcoming Posts » Working code :)

Working code :)

  • I should use this code (this will also ignore the sticky posts):

    <ul>
        <?php
        $args = array(
         'post_status' => 'future',
         'ignore_sticky_posts'    => true,
         'posts_per_page' => 5,
         'order' => 'DESC'
        );
        $my_query = new WP_Query($args);
        if ($my_query->have_posts()) {
            while ($my_query->have_posts()) : $my_query->the_post();
    
                $do_not_duplicate = $post->ID; ?>
                <li> <?php the_title(); ?>
                <span class="post-date">Expected: <?php echo get_the_date('Y-m-d');?></span>
                </li>
            <?php endwhile;
        }
        ?>
        </ul>

    http://wordpress.org/plugins/upcoming-posts/

  • The topic ‘Working code :)’ is closed to new replies.
Skip to toolbar