This is php question really.
I can put <?php include (TEMPLATEPATH . '/searchform.php'); ?> into any template, but how can i put it into "here"? <?php else : here endif; ?>
Thanks
This is php question really.
I can put <?php include (TEMPLATEPATH . '/searchform.php'); ?> into any template, but how can i put it into "here"? <?php else : here endif; ?>
Thanks
<?php else: include(TEMPLATEPATH . '/searchform.php'); ?>
is this ok?
yes it works, i was thinking that as well just want to make sure.
thanks
The "correct" method is to use <?php get_search_form();?>,
you are right esmi, but we may want to custom it for the styling.
How does that affect using the correct WP function/tag? Just create your own searchform.php template file, add it to your theme and <?php get_search_form();?> will call it automatically. I've not created a theme yet that uses the default search form.
thnanks esmi, that was beautiful!
Here I found another issue:
What if the <?php get_search_form();?> has been used 2 times on a page (e.g. the hform not only in sidebar but also in main content in 404.php)
So, there will be problems with the ID tags, W3C doesn't allow using a same ID name more than 1 time on a page.
I can copy the code from searchform.php and give some new ID names but it's not so convenient if add it to few pages.
Any better solution please?
This topic has been closed to new replies.