wordpress custom form

A last option is to write a custom function (in your functions.php file) and hook that function to the get_search_form action hook.

 

function sanofi_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="submit" id="searchsubmit" value="'. esc_attr__('Search') .'" />
</div>
</form>';

return $form;
}

 

 

http://codex.wordpress.org/Function_Reference/get_search_form

posted on 2012-08-21 17:56  myjavawork  阅读(280)  评论(0)    收藏  举报