Hiding Passed Events on Tag Page.

Home Forums Calendar Products Events Calendar PRO Hiding Passed Events on Tag Page.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #690541
    dealerdan
    Participant

    Hey guys,

    I think I read somewhere that it was by design that tag pages were in descending order, but I have a lot of events planned well in advance so I’d much prefer them to be in ascending order. I was able to do that by changing the query to the following code:

    <?php $posts=query_posts($query_string . ‘&order=asc’);
    if ( have_posts() ) : ?>

    It works as I hoped – except that any events that have already passed are showing up there, and showing up first which obviously is no good 🙂 You can see an example at: http://www.kingstonontarioevents.com/tag/movies-in-the-square/

    I was looking around single-venue.php as the functionality is used there, and also came across these links:

    https://gist.github.com/jo-snips/3542941
    http://pastebin.com/uHCEjEiB

    That were shared on the forum before, and tried a few different things but had no luck.

    Wondering if you guys had any ideas or suggestions – if not no worries, as I know it can be a lot to ask 🙂

    #692237
    Brook
    Participant

    Howdy dealerdan,

    That is a great question. It is possible. The meta field ‘_EventStartDate’ and ‘_EventEndDate’ can be used to filter out events based on their start and or end times. Since you are already modifying that query, try adding some parameters that would filter out events based on their start or end times (use the end date if you want currently ongoing events to be included on the page). Keep in mind though that the purpose of the tag page is partially for search engines. By removing archived items from an archive page like tags, you could be causing your site harm in unexpected ways. But, if that is your wish, the above is how I’d do it.

    Hopefully that makes sense. If I can answer some more high level stuff regarding this please let me know. Cheers!

    – Brook

    #692757
    dealerdan
    Participant

    Thanks Brook – appreciate the help. Hopefully will be good to go from that. Cheers.

    #700357
    Brook
    Participant

    Excellent! Please feel free to open a new topic should you ever have more API questions. I am going to archive this one since it is resolved. Cheers!

    – Brook

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Hiding Passed Events on Tag Page.’ is closed to new replies.