<?php
// Equipment Category Dropdown, thanks http://frankiejarrett.com/2011/09/create-a-dropdown-of-custom-taxonomies-in-wordpress-the-easy-way/
function exc_custom_taxonomy_dropdown( $taxonomy, $orderby, $order, $hierarchical, $show_count, $name) {
$args = array(
'orderby' => 'name',
'order' => 'ASC',
'hierarchical' => true,
'show_count' => true,
);
$terms = get_terms( $taxonomy, $args );
$name = ( $name ) ? $name : $taxonomy;
if ( $terms ) {
printf( '<select name="%s" class="postform">', $name );
foreach ( $terms as $term ) {
printf( '<option value="%s">%s (%s)</option>', $term->slug, $term->name, $term->count );
}
print( '</select>' );
}
}
?>
<form role="search" method="get" id="equipfilter" action="<?php bloginfo('url'); ?>">
<fieldset>
<!--legend>Category:</legend-->
<?php exc_custom_taxonomy_dropdown( 'exc_equipment_cat', 'name', 'ASC', true, true, 'exc_equipment_cat'); ?>
- </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>