WordPress.org

Support

Support » Themes and Templates » Default Themes use Different Search Techniques – Why?

Default Themes use Different Search Techniques – Why?

  • 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>

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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.

    So the special characters hold your search string in the search “window”? That’s cool.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Default Themes use Different Search Techniques – Why?’ is closed to new replies.
Skip to toolbar