EDITED MY QUESTION TO MAKE IT WAY MORE CONCISE
Using WordPress plugin Events Manager, my goal is to alter the search form so it searches for events on single dates. I don’t want a date range search which is built in.
Most of my events are nightclub events, which carry on to the next day. Therefore, I also want to alter the event search so that if i search for say Saturday August 18th, I don’t want it to display events that started on friday but ended on saturday at 3am.
I solved this. First add
to the events-list.php under the line:
This will stop the search from finding a date range and only search single dates. Then in events-search.php, remove the second box for end-date.
then in events manager plugin folder “classes” file em-events.php
This is what it should look like from line 196. Please note, I got rid of the extra spaces between lines so my line 196 may not be the same as yours.. do a search for “if ( $events_count > 0 )” and that is the line I’ll start from:
I discovered a setting that solves this problem without having to hack the code:
Events manager settings page -> Pages tab -> Event/List Archives
You’ll find an option “Are current events past events?” set to yes. This will, for example, cause searches for sunday to not display events that started the saturday before.
Then just make the search form have a date input but not a date range input.. Seems to work great for me.