Hide ongoing events in Photo/List view, still visible in categories

Home Forums Calendar Products Events Calendar PRO Hide ongoing events in Photo/List view, still visible in categories

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #960321
    Marc
    Participant

    We post many ongoing events (like multiple month long art exhibitions) to our site, which makes them continuously stay at the top of the month and photo views since they have the earliest start date. Is there a way to remove them from the photo and list views but have them still visible if someone clicks on the category they are in? Otherwise the same few events are always at the top when people return to our site and we want that day’s events to be the first thing people see. Thanks!

    #960405
    Josh
    Participant

    Hey Marc,

    Thanks for reaching out to us!

    This is definitely a great question. One thing you could do is to follow our Themer’s Guide to copy the Photo and List View templates into your theme. Next you can add a test before displaying the single-event.php file for each of these views that tests whether the start date for the event occurs before the current day. If it does, you can prevent that event from displaying in the loop.

    To do this you’ll need two things:

    1. The Unix timestamp for the start date of the events. This can be found using the following function tribe_get_start_date( get_the_ID(), false, ‘U’);
    2. The Unix timestamp for the current day. This can be found using time();

    Before displaying the single-event details, test to see if the current day is greater than the start day for the event. If it is, don’t display that event.

    Let me know if this helps.

    Thanks!

    #984146
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Hide ongoing events in Photo/List view, still visible in categories’ is closed to new replies.