Form to Filter/Sort Post On Taxonomy page

Hi, I am trying to build a form similar to the WP search form, that will allow me to refine/filter/sort posts on taxonomy and search results page. The code I have so far is this – `<form method=”get” id=”searchform” name=”searchform” action=”<?php echo $PHP_SELF; ?>”>

<label>Keywords</label><br />

<input type=”text” class=”search form-text” name=”s” id=”s” value=”<?php echo trim( get_search_query() ); ?>” placeholder=”Type keywords here” />

</fieldset>

<select name=”post_type”>

<option value=”product” style=”color: #000;”>Legal Documents</option>

<option value=”videos”>Legal Advice – Videos</option>

<option value=”link”>Legal Advice – Links</option>

<option value=”text”>Legal Advice – Articles</option>

<option value=”post_type_c”>An Attorney</option>

</select>

<?php

//first get the current term

$current_term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) );

//then set the args for wp_list_categories

$args = array(

‘child_of’ => $current_term->term_id,

‘taxonomy’ => $current_term->taxonomy,

‘hide_empty’ => 0,

‘hierarchical’ => true,

‘depth’ => 2,

‘title_li’ => ”

);

wp_dropdown_categories( $args );

?>

<?php wp_dropdown_categories(‘show_option_all=All U.S. States&taxonomy=states&depth=2&orderby=name&show_count=1’:wink:; ?>

<fieldset>

<button tabindex=”2″ type=”submit” class=”search_btn”>

<span style=”background-image:url(‘/wp-content/uploads/2012/08/smallglass.png’:wink:; background-repeat:no-repeat; display:inline-block; margin:0px auto; height:20px; width:20px; text-align:center;”></span>

</button>

</form>`

More info on my question asked can be found at – http://wordpress.stackexchange.com/questions/76196/filter-sort-post-form-on-taxonomy-page

However the URL returned looks like this – http://MYDOMAIN.com/blog/videoscategory/wills-trusts-and-estates/?s=&post_type=product&Wills+=0&cat=189&cat=0

How can I adjust this so that it filters the current posts on the page?

  • aecnu
    • WP Unicorn

    Greetings paul_jones,

    Thanks for bringing this up, it certainly sounds like a useful customization.

    Unfortunately, custom coding is not currently available – but we would love to put it into consideration for future development

    I have moved this ticket to the applicable feature requests area and I have alerted the lead developers to the request.

    It might take a bit longer than useful but alternatively, you could see if there’s a developer available at wpmu jobs who could get onto it right this minute

    Thank you for being a WPMU DEV Community Member!

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.