Format Non-JavaScript Search Results
Learn to create the template file that shows the search results.
The search results page is powered by a file search.php
. If it is not found, then index.php
is used to display the page.
Create the file search.php
in the theme folder and write a test message like Hello from the search results page. If we refresh the search results page (or perform a search using the form on the Search page and click submit), we should be able to see this message.
For the search results page, copy the contents of index.php
into search.php
and then customize the code to display search results differently.
Page title
The title of the page is Search Results. The description is Results for "xyz", where "xyz" is the actual search string from the form.
Get hands-on with 1400+ tech skills courses.