テーマによって異なりますが、ウィジェットでサイト内検索ボックス追加した際に、
入力フォームの前に以下の様な「検索:」が表示されてしまっている。
その「検索:」を消したい場合の対象方法。

スクリーンショット_061314_051343_PM

方法

「\wp-content\themes\対象のテーマ\」にsearchform.phpを設置する。

ソースの中身
[php]



[/php]

これのみで完了!

※注意
ファイルの文字コードを注意してください。
上記は「検索」を日本語を利用しているので、ファイルの文字コードをUTF-8を利用しました。

なぜファイルを置いただけで動作をするか?

\wp-includes\general-template.php
内の204行目(バージョン:3.9.1)より以下のソースで指定されている為です。

[php]
function get_search_form( $echo = true ) {
/**
* Fires before the search form is retrieved, at the start of get_search_form().
*
* @since 2.7.0 as ‘get_search_form’ action.
* @since 3.6.0
*
* @link https://core.trac.wordpress.org/ticket/19321
*/
do_action( ‘pre_get_search_form’ );

$format = current_theme_supports( ‘html5’, ‘search-form’ ) ? ‘html5’ : ‘xhtml’;

/**
* Filter the HTML format of the search form.
*
* @since 3.6.0
*
* @param string $format The type of markup to use in the search form.
* Accepts ‘html5’, ‘xhtml’.
*/
$format = apply_filters( ‘search_form_format’, $format );

$search_form_template = locate_template( ‘searchform.php’ );
if ( ” != $search_form_template ) {
ob_start();
require( $search_form_template );
$form = ob_get_clean();
} else {
if ( ‘html5’ == $format ) {
$form = ‘

‘;
} else {
$form = ‘

‘;
}
}

[/php]