使用此函数输入函数。cat=22过滤器的php文件更改您的cat id
function my_search_form( $form ) {
$form = \'<form role="search" method="get" id="searchform" action="\' . home_url( \'/\' ) . \'" >
<div><label class="screen-reader-text" for="s">\' . __(\'Search for:\') . \'</label>
<input type="text" value="\' . get_search_query() . \'" name="s" id="s" />
<input type="text" value="22" name="cat" id="scat" />
<input type="submit" id="searchsubmit" value="\'. esc_attr__(\'Search\') .\'" />
</div>
</form>\';
return $form;
}
add_filter( \'get_search_form\', \'my_search_form\' );