WordPress Site Search

Adding search functionality is a wonderful way to add functionality and pleasure to a visitors experience on your website and there are many wonderful ways to add WordPress site search to your website: 

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

If your templates supports it you can just add:
<?php include (TEMPLATEPATH . '/searchform.php'); ?>

(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>

 How to quickly add site search to your WordPress website.

  • 204 Users Found This Useful

Was this answer helpful?

Related Articles

Install WordPress on Host

With Ultra Web Hosting you can install WordPress on your hosting account with us in seconds....

WordPress Error : Sorry, this file type is not permitted for security reasons

.svg and .xap files can result in the error "Sorry, this file type is not permitted for security...

Elementor - Critical Error with both Elementor and Elementor Pro plugins enabled

Running both Elementor and Elementor Pro at the same time requires more memory than provided by...

Not Receiving Form Email Through WordPress - SMTP

If you are not able to sent email or receive email from your WordPress contact form, you can...

WordPress Security

Even with many layers of server security, if a WordPress install is not constantly updated and...