WordPress template tags the_ search_ Query is used to output search keywords, which are usually used in search forms and search results pages.
the_search_query()
The function does not have any parameters and can be called directly.
Examples of function usage
<form method="get" id="searchform" action="<?php bloginfo('url'); ?>/"> <div> <input type="text" value="<?php the_search_query(); ?>" name="s" id="s" /> <input type="submit" id="searchsubmit" value="Search" /> </div> </form>
Extended reading
the_ search_ The query() function is located in: WP includes / general- template.php
Related Tags:
- get_ search_ query()