WordPress search form quick modification
Posted on August 2nd in WordPress
In WordPress you might see a search form. And if you look deeper in your WordPress template files, you can find that there is no searchform.php file! So how can you change this search form content?
It seems to be a very popular problem. But we have the solution.
Actually, WordPress automatically generates a form if no searchform.php exists. So, you need to create your own search form page if you want to modify it . Just create searchform.php using the following simple HTML coding and it will work
<form method="get" id="search-form" action="<?php bloginfo( 'home' ); ?>/">
<input type="text" value="Enter Text" name="s" id="s" onfocus="if (this.value == 'Enter Text') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter Text';}" />
<input type="submit" name="submit" id="search-submit" value="Search" />
</form>
By the way it will give your search form same effect as ours.





