• Hi

    I’ve had a search round the forum and cant seem to find anything about this!

    Im using WordPress to list upcoming events on a page.

    I’ve created a custom field ‘event-date’ which holds a date in the future when the event will happen.

    I’ve ordered the loop to show the closest date at the top of the list but now I need to automatically remove posts for events that have already passes allowing the next event to move to the top of the list.

    Here’s an example of my page…
    https://www.our-pub.co.uk/Pubs/Duke2.php

    Here’s the loop i’m currently using…

    <?php
    $posts = get_posts('category=3&author=23&numberposts=3&order=ASC&orderby=event-date');
    foreach ($posts as $post) : start_wp(); ?>

    Any help would be very much appreciated! I’ve been trying to solve this for ages but now I’m really out of ideas!

    Thanks,
    Bruce

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Exclude Posts From Loop After Today's Date’ is closed to new replies.