WordPress Theme Development 8 - Search Form
There is a new template tag for search form, get_search_form();, in WordPress version 2.7.
However, the template tag will look for search form, searchform.php, first. If the file does exists, it will use that file. If not, it will generate the HTML. We decided to use this new template tag. Hence, we will replace the code as following in sidebar file, sidebar.php.
Now, new search code in sidebar file, sidebar.php, will look as following.
After using the new search template tag in sidebar file, sidebar.php, we move the old search code to a search form file called searchform.php. There is a example of search form file as following.
Related Posts
- WordPress Theme Development 1 - Start with Theme Style Sheet
- WordPress Theme Development 2 - Minimum Main Index Template
- WordPress Theme Development 3 - Header
- WordPress Theme Development 4 - Footer
- WordPress Theme Development 5 - Sidebar
- WordPress Theme Development 6 - Theme Functions
- WordPress Theme Development 7 - Comments
Comments
Comments powered by Disqus