WordPress.org

Ready to get started?Download WordPress

Forums

Default Themes use Different Search Techniques - Why? (3 posts)

  1. Lorelle
    Member
    Posted 9 years ago #

    I have found two different searches between the Classic Theme and the Default Theme. What's the difference and why are they different? Is one "better" than the other?

    Classic:
    <form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <div>
    <input type="text" name="s" id="s" size="15" /><br />
    <input type="submit" name="submit" value="<?php _e('Search'); ?>" />
    </div>
    </form>

    Default:
    <form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    <div><input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" name="Submit" value="Go!" />
    </div>
    </form>

  2. Avenir
    Member
    Posted 9 years ago #

    I don't think they're any different in the way they do the search, just that in the default theme, after performing a search, the search form will still display your search string, but it won't in the classic theme. That's because of the <?php echo wp_specialchars($s, 1); ?> in the default theme. I like keeping the search string displayed so that if you get totally different results than what you were searching for, you can check what you typed and make sure you typed it right.

  3. Lorelle
    Member
    Posted 9 years ago #

    So the special characters hold your search string in the search "window"? That's cool.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.