• OK, I know this will probably make me feel really stupid, because I know once I post this I’m gonna find the answer … but I’ve not had any luck so far. Can someone point me toward the tag for the default WP search box? I’ve searched the docs and the wiki, and can only find links to an enhanced plug-in search …
    Best,
    James

Viewing 4 replies - 1 through 4 (of 4 total)
  • There is nothing in your index or your css.
    Here’s what I have:
    <li id="search">
    <label for="s"><?php _e('Search:'); ?></label>
    <form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>">
    <div>
    <input type="text" name="s" id="s" size="12" />
    <input type="submit" name="submit" value="<?php _e('Look'); ?>" />
    </div>
    </form>


    Put the above inside the menu div where you want it to appear.
    The bit below is the default css:
    #menu form {
    margin: 0 0 0 13px;
    }
    #menu input#s {
    width: 80%;
    background: #eee;
    border: 1px solid #999;
    color: #000;
    }

    You need to insert someting like this :
    <form id="searchform" method="get" action="index.php"> <input type="text" name="s" id="s" size="15"/> <input type="submit" name="submit" value="<?php _e('Search'); ?>"/></form>
    It’s present by default in the index.php file.
    Don’t erase what you’re not able to rewrite. Comment what you don’t want instead 🙂

    Thread Starter jbickers

    (@jbickers)

    OK, restored the search code from the original index.php (duh). Now, getting this error:
    Fatal error: Call to undefined function: _e()
    ???

    “<meta name=”generator” content=”WordPress 1.0.2″
    You are using an old version of wp. For now though, just change this:
    value="<?php _e('Search'); ?>"/>
    to this:
    value="Search"/>
    The _e part is for translation purposes.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Adding a search box?’ is closed to new replies.