Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Equipment Category Dropdown, thanks https://gist.github.com/2902509
- class Walker_SlugValueCategoryDropdown extends Walker_CategoryDropdown {
- function start_el(&$output, $category, $depth, $args) {
- $pad = str_repeat(' ', $depth * 3);
- $cat_name = apply_filters('list_cats', $category->name, $category);
- $output .= "\t<option class=\"level-$depth\" value=\"".$category->slug."\"";
- if ( $category->term_id == $args['selected'] )
- $output .= ' selected="selected"';
- $output .= '>';
- $output .= $pad.$cat_name;
- if ( $args['show_count'] )
- $output .= ' ('. $category->count .')';
- if (isset ( $args['show_last_update'] ) ) {
- $format = 'Y-m-d';
- $output .= ' ' . gmdate($format, $category->last_update_timestamp);
- }
- $output .= "</option>\n";
- }
- }
- ?>
- <form role="search" method="get" id="equipfilter" action="<?php bloginfo('url'); ?>">
- <fieldset>
- <?php
- $dropdown_args = array(
- 'taxonomy' => 'exc_equipment_cat',
- 'name' => 'exc_equipment_cat',
- 'show_option_none' => 'Select category',
- 'show_count' => 1,
- 'orderby' => 'name',
- 'hierarchical' => true,
- 'echo' => 1,
- 'walker' => new Walker_SlugValueCategoryDropdown);
- wp_dropdown_categories( $dropdown_args );
- ?>
- </fieldset>
- <fieldset>
- <legend>Kw Range:</legend>
- <input type="text" name="kw_min" placeholder="from" value><br />
- <input type="text" name="kw_max" placeholder="to" value>
- </fieldset>
- <fieldset>
- <legend>Price Range:</legend>
- <input type="text" name="pr_min" placeholder="from" value><br />
- <input type="text" name="pr_max" placeholder="to" value>
- </fieldset>
- <input type="submit" id="filtersubmit" value="Search" />
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement