Title: Searching Multiple Categories
Last modified: August 20, 2016

---

# Searching Multiple Categories

 *  Resolved [markboulder](https://wordpress.org/support/users/markboulder/)
 * (@markboulder)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/searching-multiple-categories/)
 * I’d like my users to be able to search multiple categories at once on the location
   search page, preferably by choosing categories from a checkbox group. I’ve searched
   and read the docs. yet I’m not sure how to go about accomplishing this.
 * [http://wordpress.org/extend/plugins/events-manager/](http://wordpress.org/extend/plugins/events-manager/)

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

 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/searching-multiple-categories/#post-3603665)
 * do you have a sample link for us to see and analyze? also, did you mean events
   search form at templates/templates/events-search.php ?
 * [http://wp-events-plugin.com/documentation/using-template-files/](http://wp-events-plugin.com/documentation/using-template-files/)
 *  Thread Starter [markboulder](https://wordpress.org/support/users/markboulder/)
 * (@markboulder)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/searching-multiple-categories/#post-3603682)
 * This is development work for a client, so unfortunately I can’t freely give out
   the development link (plus it’s currently restricted by ip address). I am referring
   to events-search.php. I have searched the forums extensively, and the only solution
   I saw suggested adding a multi-select, or replacing the select with a checkbox
   group, but I am still not sure how and where I’d modify the corresponding sql
   statement. The function wp_dropdown_categories could perhaps be replaced with
   wp_category_checklist but I’m not quite sure how to implement that effectively,
   and more importantly, what else I’d need to modify in events manager to make 
   it work. From events-search.php:
 *     ```
       <?php if( get_option('dbem_search_form_categories') ): ?>
       		<!-- START Category Search -->
       			<?php
       				$selected = !empty($_REQUEST['category']) ? $_REQUEST['category'] : 0;
       				EM_Object::ms_global_switch(); //in case in global tables mode of MultiSite, grabs main site categories, if not using MS Global, nothing happens
       				wp_dropdown_categories(array( 'hide_empty' => 0, 'orderby' =>'name', 'name' => 'category', 'hierarchical' => true, 'taxonomy' => EM_TAXONOMY_CATEGORY, 'selected' => $selected, 'show_option_none' => get_option('dbem_search_form_categories_label'), 'class'=>'em-events-search-category'));
       				EM_Object::ms_global_switch_back(); //if switched above, switch back
       			?>
       		<!-- END Category Search -->
       		<?php endif; ?>
       ```
   
 * I really appreciate any ideas on this one. I currently have a number of categories
   that need to have the capability to be multi-selected and displayed with the 
   search (ie, show all posts that match any of the selected categories).
 *  [agelonwl](https://wordpress.org/support/users/angelonwl/)
 * (@angelonwl)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/searching-multiple-categories/#post-3603794)
 * you need to work on template files events-search.php and events-list.php
 * e.g. `$args['category'] = $_REQUEST['category']` in events-list.php
 *  [Daedalon](https://wordpress.org/support/users/daedalon/)
 * (@daedalon)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/searching-multiple-categories/#post-3603898)
 * Markboulder, did you get this done?

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

The topic ‘Searching Multiple Categories’ is closed to new replies.

 * ![](https://ps.w.org/events-manager/assets/icon-256x256.png?rev=3550347)
 * [Events Manager - Calendar, Bookings, Tickets, and more!](https://wordpress.org/plugins/events-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/events-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/events-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/events-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/events-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/events-manager/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Daedalon](https://wordpress.org/support/users/daedalon/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/searching-multiple-categories/#post-3603898)
 * Status: resolved