我将2个类别拉入2个下拉列表。当我点击提交时,URL会显示过滤,但它只是加载主页。我希望用户能够选择多个类别并提交以显示结果。
<?php $price = array(
\'show_option_all\' => \'\',
\'show_option_none\' => \'Price Range:\',
\'orderby\' => \'ID\',
\'order\' => \'ASC\',
\'show_count\' => 1,
\'hide_empty\' => 1,
\'child_of\' => 110,
\'exclude\' => \'\',
\'echo\' => 1,
\'selected\' => 0,
\'hierarchical\' => 1,
\'name\' => \'price\',
\'id\' => \'\',
\'class\' => \'styled-select\',
\'depth\' => 0,
\'tab_index\' => 0,
\'taxonomy\' => \'category\',
\'hide_if_empty\' => false
); ?>
<?php $region = array(
\'show_option_all\' => \'\',
\'show_option_none\' => \'Region:\',
\'orderby\' => \'ID\',
\'order\' => \'ASC\',
\'show_count\' => 1,
\'hide_empty\' => 1,
\'child_of\' => 32,
\'exclude\' => \'\',
\'echo\' => 1,
\'selected\' => 0,
\'hierarchical\' => 1,
\'name\' => \'region\',
\'id\' => \'\',
\'class\' => \'styled-select\',
\'depth\' => 0,
\'tab_index\' => 0,
\'taxonomy\' => \'category\',
\'hide_if_empty\' => false
); ?>
<div class="search">
<form method="get" action="<?php bloginfo(\'siteurl\'); ?>" id="category" >
<div class="four columns">
<div class="search_drop"><?php wp_dropdown_categories( $price); ?> </div>
</div>
<div class="four columns">
<div class="search_drop"><?php wp_dropdown_categories( $region); ?> </div>
</div>
<div class="four columns">
<input type="submit" name="submit" value="Filter" class="button" /></form>
</div>
</div>