adding custom styles to search widget in wordpress

Many people having issue when creating the wordpres theme and show search widget in theme. wordpress tutorial, adding custom styles to search widget in wordpress. In this tutorial we will show you how to show search widget with our custom styling.

adding custom styles to search widget in wordpress

you can override the default wordpress search widget.

adding custom styles to search widget in wordpress
adding custom styles to search widget in wordpress

For that use the following code.


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

</form>
</li>
</ul>


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

–>