capri
capri

Reputation: 2127

How to set search box in wordpress?

I'm using this search form, is there any plugin to perform search in WordPress ? I use link as button here.

<div class="search_area">
<form role="search" method="get" id="searchform" action="<?php echo home_url( '/' ); ?>">

<div class="search_txt">Search</div>                                    

<?php $search_text = __(" " ); ?>           

<div class="search_field"> <input type="text" class="field"  value="<?php echo $search_text; ?>" onblur="if (this.value == '')  
{this.value = '<?php echo $search_text; ?>';}"  onfocus="if (this.value == '<?php echo $search_text; ?>')  {this.value = '';}" />  
</div>

<div class="search_icon">

<a name="sub" href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image28','','<?php bloginfo('template_url');?>/images/search_icon-hover.jpg',1)"> 
<img src="<?php bloginfo('template_url');?>/images/search_icon-normal.jpg" name="Image28" width="28" height="24" border="0" id="Image28" /></a>
</div>
</form>
</div>

Upvotes: 0

Views: 4757

Answers (1)

Libin
Libin

Reputation: 2462

WordPress default Search form is really powerful and can customize.

<div class="only-search with-image">
<?php get_search_form(); ?>
</div>

Just paste the above code and it will display search box with a search image inside the box. Function Reference

If you wants to create your own search page then refer this.

Also there is a plugin to increases WordPress' default search functionality. - Search Everything

Check it. Cheers !!!

Upvotes: 3

Related Questions