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>
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….
- The topic ‘Upcoming posts code’ is closed to new replies.