hide events that have started already

Home Forums Calendar Products Events Calendar PRO hide events that have started already

Viewing 4 posts - 16 through 19 (of 19 total)
  • Author
    Posts
  • #1058326
    Matthew
    Participant

    Hi Josh,

    I tried putting the single-event.php in the list folder in my child theme with the code you gave me. It has worked to some degree but now I have a strange display where the events that have started take up space but are not visible so you have to click ‘Next Events’ a bunch of times to get to the events. I recorded a screencast to show you:

    https://drive.google.com/file/d/0Bwi8XsZZg622Y08yMnhHenZxZE0/view

    Thanks,
    Mat

    #1058699
    Josh
    Participant

    Hey Mat,

    Ah, that actually makes sense. Since the query has already run, we’re just preventing the display of the event as they’re looped. This means, the count of “10” events will loop and paginate but may only output a couple of events based on our display limitation.

    I believe the best approach for a customization like this on the list based views would be to filter the results using “pre_get_posts” and limiting what events get pulled prior to the loop. Unfortunately, I don’t currently have a solution for this particular issue however it does sound like it could be a good Knowledgebase article topic so I am noting that for a potential future article.

    Also, since this isn’t something that is easily accomplished without customization, you can reach out on our UserVoice page and make a feature request for this particular display option.

    Let me know if this helps.

    Thanks!

    #1060827
    Matthew
    Participant

    Hi Josh,

    Thanks for trying on this one. Obviously I’m a little disappointed with the outcome, I would have thought not displaying events that have already started was just common sense. I’ve submitted a user voice request but I really think this should be added to the basic plugin, after all, you can’t attend an event that started yesterday 🙂

    I will have to speak to a developer about making the customization. Will telling them what I’m after and that they should use “pre-get-posts” be enough for them to know what to do? If not could you post any more instructions they may need here before closing the thread?

    Thanks,
    Mat

    #1061751
    Josh
    Participant

    Hey Mat,

    Sorry I wasn’t able to give you more detail on this particular approach. Thanks for adding the feedback on our UserVoice page!

    Yes, a developer should be familiar with using “pre_get_posts()” and could do a little bit of research to determine how to filter out already started events that way.

    I’ll go ahead and close this thread for now. If you have any further questions, please don’t hesitate to open a new one.

    Thanks!

Viewing 4 posts - 16 through 19 (of 19 total)
  • The topic ‘hide events that have started already’ is closed to new replies.