Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Where can I change the text in the search box widget? WordPress

  • SOLVED

here is a link to my blog site:
[[LINK href="http://caligreen.com/chriscutfries/"]]http://caligreen.com/chriscutfries/[[/LINK]]

The default text in the search box currently reads "To search, type and hit enter". I'm lost in all of the files that make up the blog, can anyone point me to the file that defines this message in the text box.

thanks,
chris

Answers (5)

2010-05-15

Nehal Rupani answers:

Hi Chris,

Let me guide you through wordpress.

1) Go to wordpress root folder->wp-content->themes->your_theme->sidebar.php
2) Click on function(i guess your using some IDE) for <?php get_search_form(); ?>
3) it will take you to page from where this functions comes from.
4) find <input type="textbox"> with in that file and change value attribute like value="Search here..".

i hope this will help to result some answer.


chris scott comments:

That wasn't exactly it but it got me looking in the right place, it was in..

wp-content > themes > thematic > functions.php

which lead me to:
wp-content > themes > thematic > library > extensions > widgets-extensions.php

that's where the code was.
thanks Nehal

2010-05-14

Utkarsh Kukreti answers:

In the theme folder, searchform.php (or a similar name), find
<input id="s" name="s" type="text" value="To search, type and hit enter" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" size="32" tabindex="1" />

2010-05-14

Gustavo Bordoni answers:

Hi Chris, the following code create a custom Search Box:

<?php
function search_nav_menu() { ?>
<li class='nav_right search'>
<form class='search_form' method='get' action=''><input type='text' name='s' id='s' value='search' onfocus="if (this.value==='search') this.value='';" onblur="if (this.value=='') this.value='search';"/></form>
</li>
<?php
}
add_action('thesis_hook_last_nav_item','search_nav_menu');
?>


And you can use this CSS:

.custom ul.menu li {
float:right;
font-size:10px;
height: 22px;
letter-spacing:1px;
overflow:hidden;
}

.custom ul.menu li.search {
background-color: #CCC;
border-bottom:none;
height:25px;
margin-bottom:0;
}

.custom ul.menu li.search input {
background-color: #CCC;
border:1px solid #333;
color:#333;
font-size:10px;
height:18px;
letter-spacing:1px;
padding:4px 10px 0 22px;
width:125px;
}

2010-05-14

Oleg Butuzov answers:

Utkarsh Kukreti has right answer, in theme should be the searchform.php

2010-05-14

Ehthisham tk answers:

<?php get_search_form(); ?>
the above function creates your form .You don't need to use that function just create your form instead of calling the above function create a custom one and just change action=,name= ,and value=[ please see below bolded chars]. then you can style as you needed

<form name="" action="<strong><?php bloginfo('url'); ?>/</strong>" method="post">
<input type="text" <strong>name="s"</strong> class="searchtxt" <strong>value="<?php the_search_query(); ?>" /</strong>>
<input type="submit" name="submit" class="searchbutton" value=""/>
</form>