Title: Working code :)
Last modified: August 21, 2016

---

# Working code :)

 *  [Melroy](https://wordpress.org/support/users/danger89/)
 * (@danger89)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/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/](http://wordpress.org/plugins/upcoming-posts/)

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

 * ![](https://s.w.org/plugins/geopattern-icon/upcoming-posts.svg)
 * [Upcoming Posts](https://wordpress.org/plugins/upcoming-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/upcoming-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/upcoming-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/upcoming-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/upcoming-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/upcoming-posts/reviews/)

## Tags

 * [list](https://wordpress.org/support/topic-tag/list/)
 * [posts](https://wordpress.org/support/topic-tag/posts/)
 * [wp_query](https://wordpress.org/support/topic-tag/wp_query/)

 * 0 replies
 * 1 participant
 * Last reply from: [Melroy](https://wordpress.org/support/users/danger89/)
 * Last activity: [12 years, 7 months ago](https://wordpress.org/support/topic/working-code/)
 * Status: not resolved