Title: Upcoming posts code
Last modified: August 19, 2016

---

# Upcoming posts code

 *  [intcon](https://wordpress.org/support/users/intcon/)
 * (@intcon)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/upcoming-posts-code/)
 * Hi…
 * I borrowed this bit of code
 *     ```
       <h2>Future Posts</h2>
       <ul>
       <?php query_posts('showposts=5&post_status=future'); ?>
       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       <li><?php the_title(); ?><span class="date"><?php the_time('j. F Y'); ?></span></li>
       <?php endwhile;
       else: ?><li>No future Posts.</li>
       <?php endif; ?>
       </ul>
       ```
   
 * from [http://www.snilesh.com/resources/wordpress/wordpress-tips-and-tricks/wordpress-display-future-upcoming-posts/comment-page-1/#comment-3860](http://www.snilesh.com/resources/wordpress/wordpress-tips-and-tricks/wordpress-display-future-upcoming-posts/comment-page-1/#comment-3860)
 * I ended up moving the else: line up with the endwhile line and then it posted
   almost correctly, except it doesn’t actually display any scheduled posts. So 
   I changed “future” to “scheduled” and that didn’t work either…it just displays
   the line that says No future posts.
 * Is there a fix to this? It looks like what I need, but I think it just needs 
   a little filling out….
 * thanks!
 * carrie

Viewing 1 replies (of 1 total)

 *  Thread Starter [intcon](https://wordpress.org/support/users/intcon/)
 * (@intcon)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/upcoming-posts-code/#post-2013893)
 * here’s something similar from smashing magazine…
 *     ```
       <?php query_posts('showposts=10&post_status=future'); ?>
       <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
       		<h2><?php the_title(); ?></h2>
       		<span class="datetime"><?php the_time('j. F Y'); ?></span></p>
       <?php endwhile; else: ?><p>No future events scheduled.</p>
       <?php endif; ?>
       ```
   
 * but again, it doesn’t show any upcoming posts…..thoughts?

Viewing 1 replies (of 1 total)

The topic ‘Upcoming posts code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [intcon](https://wordpress.org/support/users/intcon/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/upcoming-posts-code/#post-2013893)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
