I put the following searchform in my front page:
<form id="searchform" method="get" action="<?php bloginfo('home'); ?>"> <input type="text" name="s" id="s" size="25" /> <input type="submit" value="<?php esc_attr_e('Search Postpositive'); ?>" /></form>
It works fine when the page is accessed from the index.php in www root (i.e.
But if someone goes to
I get a fatal error:
Call to undefined function: bloginfo()
I realize this is expected behavior, but is there a way to test for something (some variable?) when the
/wp-content/themes/mytheme/index.phpis called directly?
If so, I assume I could just omit the searchform (there are no other wp function calls on the page).
- The topic ‘searchform in front page returns fatal error’ is closed to new replies.