Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm fairly new to wordpress. I'm trying to develop a website with search option to find available room information.

I would like to add a search box where people would be able to enter their information and hit the Search button. Then it'll display the available rooms. Something like the below website

http://www.easytobook.com/?amu=1972100201

If it's a duplicate question please accept my apologies.

Thanks.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

I just wanted to add two small things for other peoples....

if your template supports it you can just add :

<?php include (TEMPLATEPATH . '/searchform.php'); ?>

2.adding the following code will put a text inside the search box. (like "Write your search and hit Enter" )

<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<div><input type="text" size="put_a_size_here" name="s" id="s" value="Write your search and hit Enter" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/>
<input type="submit" id="searchsubmit" value="Search" class="btn" />
</div>
</form>

and finally, combining those two advices, just save the code from part two as searchform.php in your template folder, and you can always call it with method number 1.

share|improve this answer
add comment

Please add this to your header.php file beside the RSS icon.

<form method="get" id="searchform" action="<?php bloginfo('home'); ?>/">
<div><input type="text" size="18" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
<input type="submit" id="searchsubmit" value="Search" class="btn" />
</div>
</form>

....this is simple search form...

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.