Horje
Where can I change the text in the search box widget? - Wordpress Solution
[Solved] - Where can I change the text in the search box widget? - Wordpress Solution
Try following codes
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

Solution - 1

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 3) it will take you to page from where this functions comes from. 4) find with in that file and change value attribute like value="Search here..". i hope this will help to result some answer.


Solution - 2

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" />


Solution - 3

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;
}


Solution - 4

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


Solution - 5

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

name="s" class="searchtxt" value="" />

Date: 2022-10-21 05:22:33
Category: Wordpress
More for You