Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*ADDING TAG SEARCH FILTER*/
- 1. create folders plugins/events-manager/templates within your current theme
- 2. copy template files events-search.php and events-list.php from /wp-content/plugins/events-manager/templates/templates to your newly created folders within your theme
- 3. edit template file /wp-content/themes/your-current-theme/plugins/events-manager/templates/events-search.php
- INSERT THIS SNIPPET
- <?php
- $selected = !empty($_REQUEST['search-tag']) ? $_REQUEST['search-tag'] : 0;
- wp_dropdown_categories(array( 'hide_empty' => 0, 'name' => 'search-tag', 'hierarchical' => true, 'taxonomy' => EM_TAXONOMY_TAG, 'selected' => $selected, 'show_option_none' => 'All Tags', 'class'=>'em-events-search-tag', 'orderby' =>'name'));
- ?>
- BELOW
- <?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; ?>
- 4. edit template file /wp-content/themes/your-current-theme/plugins/events-manager/templates/events-list.php
- INSERT THIS SNIPPET
- if ( $_REQUEST['search-tag'] != '-1' ){
- $args['tag'] = $_REQUEST['search-tag'];
- }
- BELOW
- em_locate_template('templates/events-search.php',true);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement