路径:/wordpress/wp-includes/general-template.php
function get_search_form($echo = true) {
do_action( 'get_search_form' );
$search_form_template = locate_template('searchform.php');
if ( '' != $search_form_template ) {
require($search_form_template);
return;
}
$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="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
</div>
</form>';
if ( $echo )
echo apply_filters('get_search_form', $form);
else
return apply_filters('get_search_form', $form);
}
然后css在每个theme的basic.css中定义
form#searchform {
float: right;
width: 180px;
}
/* IE6以前対応 */
*html form#searchform {
width: 160px;
}
form#searchform label {
display: none;
}
form#searchform input#s {width: 120px;}
form#searchform input#searchsubmit {width: 50px;}