Support » Fixing WordPress » searchform in front page returns fatal error

  • Resolved deko

    (@deko)


    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" />&nbsp;
    <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. http://www.myblog.examle.com/index.php).

    But if someone goes to

    http://www.myblog.example.com/wp-content/themes/mytheme/index.php

    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.php is called directly?

    If so, I assume I could just omit the searchform (there are no other wp function calls on the page).

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘searchform in front page returns fatal error’ is closed to new replies.