Title: Custom Filter for Events
Last modified: July 22, 2025

---

# Custom Filter for Events

 *  Resolved [jcmanlangit](https://wordpress.org/support/users/jcmanlangit/)
 * (@jcmanlangit)
 * [10 months ago](https://wordpress.org/support/topic/custom-filter-for-events/)
 * Hello good day
   Our client wants that the events page of their site be have State
   and/or Category (Event title) filter. I tried to add a new taxonomy for the Event
   State, and tried to add a custom select form, and custom pre_get_posts query,
   but it’s not working. What hook can we use to filter the events? It looks like
   the pagination and search is using ajax. So is it possible to integrate the filter
   to ajax also?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-filter-for-events%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Support [Jes](https://wordpress.org/support/users/jescandoit/)
 * (@jescandoit)
 * [9 months, 4 weeks ago](https://wordpress.org/support/topic/custom-filter-for-events/#post-18566023)
 * Hi [@jcmanlangit](https://wordpress.org/support/users/jcmanlangit/)
 * Thanks for reaching out.
 * Based on what you’re looking to do, I’d suggest reviewing our ORM documentation
   here:
   [https://docs.theeventscalendar.com/apis/orm/query/events/examples/](https://docs.theeventscalendar.com/apis/orm/query/events/examples/)
 * It provides a more flexible and manageable way to customize your queries. Once
   you’re comfortable with that, you can move forward with integrating your custom
   solution into an AJAX response.
   I hope this helps and let me know if you have
   any other questions or follow-ups.
 *  Thread Starter [jcmanlangit](https://wordpress.org/support/users/jcmanlangit/)
 * (@jcmanlangit)
 * [9 months, 4 weeks ago](https://wordpress.org/support/topic/custom-filter-for-events/#post-18566129)
 * Thanks for the reply!
 * Not sure with ORM though.
 * This was the code I was working on (State is a new custom taxonomy)
   [https://imgur.com/a/w78NKNa](https://imgur.com/a/w78NKNa)
   Then add select for State[https://imgur.com/a/oSCYgEP](https://imgur.com/a/oSCYgEP)
 * But this won’t work because of the loop in $events variable [https://imgur.com/a/Rm4DWzK](https://imgur.com/a/Rm4DWzK)(
   that is in src\views\v2\list.php)
   May we know what controls the query of the 
   $events variable? What file can the code be located that controls the query? 
   Is there a hook we can use to control the query of the $events variable for the
   filter?
 * Or is there another way to code the custom filter we want to implement?
   Thanks!
    -  This reply was modified 9 months, 4 weeks ago by [jcmanlangit](https://wordpress.org/support/users/jcmanlangit/).
 *  Plugin Support [tristan083](https://wordpress.org/support/users/tristan083/)
 * (@tristan083)
 * [9 months, 4 weeks ago](https://wordpress.org/support/topic/custom-filter-for-events/#post-18566796)
 * Hi [@jcmanlangit](https://wordpress.org/support/users/jcmanlangit/) ,
 * Thank you for your message.
 * The $events variable in `src\views\v2\list.php` is a template (see [The Events Calendar Template Files](https://theeventscalendar.com/knowledgebase/calendar-template-files-v2/?utm_sounce=tec&utm_medium=in-app&utm_campaign=help-page&id=1aiy))
   variable. I recommend reviewing the following files related to the template file
   in question:
    - `src\Tribe\Views\V2\Views\List_View.php`
    - `src\Tribe\Views\V2\View.php`
 * I’d like to note that what you’re trying to accomplish here falls outside of 
   our [scope of support](https://theeventscalendar.com/knowledgebase/k/what-support-is-provided-for-license-holders/).
 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [9 months, 3 weeks ago](https://wordpress.org/support/topic/custom-filter-for-events/#post-18571273)
 * Hi there,
 * It seems we haven’t heard back from you in a while, so I’ll go ahead and close
   this thread for now. If you still need help, feel free to reopen it or start 
   a new one—our team is always here to assist!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Custom Filter for Events’ is closed to new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

 * 5 replies
 * 4 participants
 * Last reply from: [Darian](https://wordpress.org/support/users/d0153/)
 * Last activity: [9 months, 3 weeks ago](https://wordpress.org/support/topic/custom-filter-for-events/#post-18571273)
 * Status: resolved