You’re probably hitting a WordPress bug in get_search_form()

20. huhtikuuta 2012 klo 20.04
Sijainti: Muut: Stack Overflow
Avainsanat: WordPress

If your theme has a searchform.php, you’re probably hitting Ticket #16541get_search_form() ignores $echo if searchform.php exists.

Your workaround is fine if you’re just echoing the search form anyway, but if you need to capture the output in a variable, you can work around this with output buffering:

<?php ob_start();
get_search_form();
$my_search_form = ob_get_clean(); ?>

Vastaa viestiin sen kontekstissa (Stack Overflow)