WordPress.org

Support

Support » How-To and Troubleshooting » Posting forward events

Posting forward events

  • geofftswin
    Member

    @geofftswin

    OK,
    I can display events in the future, by either use of the “Future” in the code, or by adjusting the code to convert Future – Published.

    The former causes problems if not logged in, in that the links don’t work.

    The latter option works, however, I cannot manage to get events that are now past to disappear.

    My code at present is:

    <?php
    global $post;
    $mpyposts = get_posts('numberposts=5&category=8&order=ASC');
    foreach ($mpyposts as $post):
    setup_postdata($post); ?>
    <li>
    <?php the_date(); ?><br />
    <a href="<?php the_permalink() ?>"><?php the_title(); ?></a>
    </li>
    <?php endforeach; ?>

    I assume that I need an if function of the type
    IF the_date() > today THEN display entry ELSE do nothing

    but I cannot figure out how to get it to work – any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Posting forward events’ is closed to new replies.