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.


Share this page:


Was this article useful? Have any suggestions or improvements to the information?

Also Read

JetPack says my website is offline

Jetpack Monitor says my website is offline, responding intermittently, or is extremely...

Static HTML Files Not Being Displayed with WordPress

This can occur when WordPress's .htaccess rewrites take place over the static html file. Place...

JetPack server was unable to connect with your site

"Error Details: The Jetpack server was unable to communicate with your site...

504 error - Are you sure you want to do this?

In wordpress if you receive either of the following errors when trying to upload a theme... 504...

Create Static Files with your WordPress Install

Reduce the processor and memory load of your site but publishing it into html files:...