Home › Forums › Calendar Products › Events Calendar PRO › How to hide past events
- This topic has 3 replies, 2 voices, and was last updated 9 years, 7 months ago by Brook.
-
AuthorPosts
-
June 8, 2014 at 11:01 pm #214112barn2mediaParticipant
Hi, I’m setting up this plugin for a client and they are very unhappy that past events are displaying on their site, as she obviously only wants to promote future events to her customers. How can I hide the past events from the front end?
Many thanksJune 9, 2014 at 7:18 am #214679BrookParticipantHowdy barn2media,
I would love to help you with that. I actually have a great starting point of code for you. It is a simple modification of existing snippet. It will no doubt require further testing and modification on your part, but the principle behind it is that it hooks into our tribe queries, if this is not the admin area then it adds an extra WP Query param that hides events whose end dates are before the current server time. Simple enough aye? Hopefully that will work for you. You might have to add some extra logic for edge cases and stuff though, so test the code thoroughly.
Does that all make sense? Did that work for you?
– Brook
June 9, 2014 at 7:18 am #214681BrookParticipantHowdy barn2media,
I would love to help you with that. I actually have a great starting point of code for you. It is a simple modification of existing snippet. It will no doubt require further testing and modification on your part, but the principle behind it is that it hooks into our tribe queries, if this is not the admin area then it adds an extra WP Query param that hides events whose end dates are before the current server time. Simple enough aye? Hopefully that will work for you. You might have to add some extra logic for edge cases and stuff though, so test the code thoroughly.
Does that all make sense? Did that work for you?
– Brook
October 6, 2014 at 10:36 pm #793232BrookParticipantHey I managed to double post! Since this thread has gone for a spell without any updates I am going to archive it. Should you need further assistance though please do not hesitate to open a new topic. Cheers!
– Brook
-
AuthorPosts
- The topic ‘How to hide past events’ is closed to new replies.