我有一个使用以下代码创建的搜索表单:
echo'<div class="header-img">
<form method="get" class="cat-search" action="'.esc_url( home_url( '/search' ) ).'" role="search" >
<select name="category">';
foreach ( $categories as $category ) {
echo'<option value="'.$category->slug.'">'.$category->name.'</option>';
}
echo'</select>
<input type="radio" name="gender" value="male"> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input value="Search" type="submit" />
</form>
</div>';
目前,在提交时,创建的网址看起来像这样/?category = a&amp; gender = male
如何在提交时修改网址,以便它显示为/?s = a + male