[wp-hackers] Search form issue

Rafael Ehlers rafaehlers at gmail.com
Mon Sep 5 23:48:51 UTC 2011

Why dont you use conditionals for what page is calling in your <form> tag?


<form id="foo" name="foo">
<?php if(is_page('contact')){ echo "<input type='text' name='x' />"}?>.....

On Mon, Sep 5, 2011 at 7:47 PM, Daniel Fenn <danielx386 at gmail.com> wrote:

> Hello all,
> I am currently working on a new version of my wordpress theme, and I am
> running into a serious issue. The theme guideline says that I must use
> "get_search_form();" to display the search form. Now I am running into an
> issue where the form will need different markup for the header, sidebar and
> search result page. (No I am not kidding).
> Am I correct that there is no callback function like there is in
> wp_nav_menu
> or like a walker that one can use in wp_nav_menu?
> Also is there any such thing as "if search_form(); called from header.php
> display this, elseif if called from sidebar.php display this else display
> this" type thing?
> Would anyone here have any ideas on this one?
> Thanks
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers

More information about the wp-hackers mailing list