Home › Forums › Calendar Products › Events Calendar PRO › hide events that have started already
- This topic has 18 replies, 3 voices, and was last updated 10 years, 3 months ago by
Josh.
-
AuthorPosts
-
January 19, 2016 at 12:35 am #1058326
Matthew
ParticipantHi 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,
MatJanuary 19, 2016 at 8:07 am #1058699Josh
ParticipantHey 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!
January 23, 2016 at 1:56 am #1060827Matthew
ParticipantHi 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,
MatJanuary 25, 2016 at 6:07 am #1061751Josh
ParticipantHey 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!
-
AuthorPosts
- The topic ‘hide events that have started already’ is closed to new replies.
