I am trying to create a form on the taxonomy template that will be able to filter the posts the current user is viewing. I want to use a few drop downs and submit button to do so.
My code looks like this -
`
<form method="get" id="searchform" name="searchform" action="<?php echo home_url(); ?>/blog/videoscategory/">
<?php
$term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) );
if ($term->parent == 0) {
wp_dropdown_categories('taxonomy=videoscategory&hide_if_empty=true&depth=2&show_count=0
&title_li=&child_of=' . $term->term_id);
} else {
wp_dropdown_categories('taxonomy=videoscategory&hide_if_empty=true&show_count=0
&title_li=&child_of=' . $term->parent);
}
?>
<?php wp_dropdown_categories('show_option_all=All U.S. States&taxonomy=states&depth=2&orderby=name&show_count=1'); ?>
<button tabindex="2" type="submit" class="search_btn">
<span style="background-image:url('/2012/08/smallglass.png'); background-repeat:no-repeat; display:inline-block; margin:0px auto; height:20px; width:20px; text-align:center;"></span>
</button>
</form>
`
The category pages URL looks like this - http://domain.com/blog/videoscategory/bankruptcy-law/
When I submit the form (using 2 dropdowns - sub category and custom tags taxonomy) the url returns like this - http://domain.com/blog/videoscategory/?cat=273&cat=87
How can I correct this? Or is there a better way about going about using a form to sort posts?