pageTracker._initData(); pageTracker._trackPageview(); } catch(err) {}
SidekickBlog

Improve the Wordpress search box

by Kunal Jain on Mar.07, 2009, under blogs, software

I just edited the search box at Recipe Mobile to remove the search button that used to appear under it.  The ‘Search’ button takes up too much space and is frankly unnecessary.  

Most internet users know that if you fill in a text box and hit enter, the website will see that as a click on the button tied to the search box.  Some quick searches on Google got me to Bavotsan.com.  Along with with various other PHP tips, the blog also contained a smart way to edit the php code that controls the search box.

The short tutorial on Bavotsan.com uses the default Wordpress theme which contains a file called searchform.php.  However, since my theme does not have this file, I had to look around for the appropriate code to edit.  Since the search box shows up in Recipe Mobile’s right sidebar, I looked in the file sidebar-right.php in Appearance->Themes in the Wordpress admin menu and found the appropriate code there.  New Search Bar

This is what the new search box looks like now.  The text to ‘Type and Hit Enter’ shows up in the search box when it is not being used to educate the few users who might not be net savvy.

Post to Twitter

  • Share/Bookmark

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

:, ,

3 Comments for this entry

Leave a Reply

CommentLuv Enabled

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...