Our site, keeping you up-to-date news.


Customize Search Box in WordPress

May 5, 2013 at 6:51 am | Blog | No comment


I added search boxes to my website. It is very easy to add a search box in wordpress. You need only simply add it as a widget to your sidebar, if your wordpress theme supports sidebar.

However, the search box widget may not be sufficient to satisfy some advanced requirements, for example:
1. you want to add search box to the header or other places rather than sidebar.
2. you want to add a search box with advanced query criteria, like a specific category or date etc.

before implementing the advanced features for the search box, we’d better to understand how the search box works in wordpress.

wordpress has a powerful query system. the search function is nothing special than a query as well. it queries posts or pages based on the keyword parameter “s”. for example, you want to query posts related to “aurelius”, the parameter is: “s=aurelius”, and you can try this on your web browser: http://pengbos.com/?s=aurelius, and you will get the results on aurelius.