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');

–>

Written by Purab

My name is Purab, Here is my Personal Blog: wpapi.com. I contributor of many wordpress plugins and Drupal Modules. I am core developer of Drupal. Connect to on LinkedIn or Follow @purab on Twitter or Follow me on Google+ or Write Mail to purabdk@gmail.com or Chat with me on Skype : purabdk

This article has 2 comments

  1. John Reply

    Setting the style for wordpress search widget is common requirement for blogs. Thanks for information.

Leave a Comment

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