header.php
template file. This snippet will show the search input in the header area on every page of our site.header.php
place the search input snippet you copied from before where you would like it. In our example we are removing all mentions of the default Wordpress site search and placing our search-input snippet after the has_nav_menu()
function and before the </header>
:header.php
template file and on every page on our site:page-search.php
, following the Wordpress template hierarchy.page-search.php
template file where we want the search results to render. In our example we are placing it right after the get_header()
function in the main body of our page template.search-input
code snippet any search from the site's header will take us to our new search page: