WordPress.org

Forums

Upcoming Posts
Working code :) (1 post)

  1. danger89
    Member
    Posted 1 year ago #

    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/

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Upcoming Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic