[theme-reviewers] searchform.php, why?

Mike Little wordpress at zed1.com
Mon Sep 5 11:30:41 UTC 2011


On Mon, Sep 5, 2011 at 10:21, Daniel Fenn <danielx386 at gmail.com> wrote:

> Hello all,
>
> Right now after taking a break I got my head stuck down into my theme again
> and all is good.
>
> Reading over the guidelines reads:
>
> -------
> Search Form: Must be included using get_search_form()
>
> Themes may optionally customize the search form, as searchform.php
> --------------
>
> May I ask why that is the case? I am asking right now because what happen
> in a case like mine where you need different markup for search bar in the
> header, different markup in the sidebar and last and not lease, different
> markup on the search results page.
>
> Now I recall that with the wordpress comments area it used to be where you
> had to write up your code by yourself and now it is all done by doing "
> comment_form()<http://codex.wordpress.org/Function_Reference/comment_form>".
> I fully understand that case, and wordpress give some control over it so it
> not all that bad.
>
> But with the search form, I am realy lost on that one.
>
>


WordPress also gives you control over the output of the search form too (via
the 'get_search_form' filter).

So, one reason for using the function call is that if a user of your theme
wishes to install a plugin that modifies the search form, they could do so
without having to hack your theme.

As for different mark-up, I would expect you only need different styling,
not different mark-up. But if you did need different mark-up, you could
implement that via the filter.


Mike
-- 
Mike Little
http://zed1.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20110905/f8c9f9c1/attachment.htm>


More information about the theme-reviewers mailing list