Home › Forums › Calendar Products › Events Calendar PRO › Custom Search for events
- This topic has 3 replies, 3 voices, and was last updated 10 years, 9 months ago by
Support Droid.
-
AuthorPosts
-
March 15, 2012 at 11:43 am #16812
Hunter
MemberI have a search form on the gridview page.
<form role="search" method="post" name="searchform" id="searchform" action="”>
Keyword:
events
in Category
true,
‘name’=> ‘tribe_events_cat’,
‘taxonomy’=> ‘tribe_events_cat’);
wp_dropdown_categories_test( $args )
?>between
and
Search Events
In the list view, I am taking the start and end dates from the search to get events in between those dates with this code.
= $start_date_search && $end_date_event
= $start_date_search && empty($tribe_events_end_date)): ?>
Any ideas as to why it just shows events from the current month. If I do not enter a start and end search date, all events show normal. If I enter a search date in october it shows none, when there are events there.
March 15, 2012 at 12:03 pm #16813Jonah
ParticipantHi Hunter, our code posting sucks right now but we’ll be improving it soon. For now use pastie.org or gist for pasting code snippets…
This is a bit above my head and more that we can really help with in the forums but I think what you’ll want to do here is modify the query string that’s passed in the URL. So in your form action you’ll want to dynamically pass in whatever was selected in the category drop down. Right now you’ve just got /events/upcoming and you’ll want to change that to events/category/your_selected_cat_name/upcoming/
Another option would be hooking into pre_get_posts (http://codex.wordpress.org/Plugin_API/Action_Reference/pre_get_posts) and adjusting the query based up on your search parameters there. I hope that helps and please do share whatever solution you come up with.
FYI, we are looking to add functionality like this in a future version too 🙂
March 15, 2012 at 12:03 pm #16814Jonah
ParticipantI also found this in a google search that might help: http://melandri.net/2011/12/31/multiple-categories-filter-in-wordpress-search/
July 6, 2015 at 5:00 pm #976344Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Custom Search for events’ is closed to new replies.
