Set the style for default search widget

Many people having issue when creating the wordpres theme and show search widget in theme. In this tutorial I will show you how to show default search widget with our custom styling.

you can override the default wordpress search widget.

For that use the following code.


function widget_override_search(){
?>
<li id="linkcat-2">
 <h2> <span>Wordpress Search</span></h2>
 <ul>
<form id="searchform" method="get" action="<?php bloginfo('home'); ?>" style="padding:10px">
<div>
<input type="text" name="s" id="s" size="50" />
<input type="submit" id="searchsubmit" value="<?php echo attribute_escape(__('Search')); ?>" />
</div>
</form>

 </ul>
</li>

<?php
}
if ( function_exists('register_sidebar_widget') )
 register_sidebar_widget(__('Search'), 'widget_override_search');

You may like following Articles!

15 thoughts on “Set the style for default search widget

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>