WordPress.org

Ready to get started?Download WordPress

Forums

Upcoming posts code (2 posts)

  1. intcon
    Member
    Posted 3 years ago #

    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

    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

  2. intcon
    Member
    Posted 3 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.