(line 14) name="s" together with value=search_term tells wordpress to add the home url in #1 with parameters “s=search_term“.

#1,#2,#3 together tells wordpress to access the url http://your_home_url/?s=search_term when the button is pressed. This triggers wordpress to do the search and display search results by template search.php.

Line 19 and 22 is an HTML trick to use a button and an icon as the submit button for the form.

Search Listing

As described above, after the wordpress executes the search it uses the template search.php to display results. The codes are as follows (you can also find the file on my Github):

Line 1-9: theme file description & inlude header.php

Line 10-15: multi-language header string format

This creates a string format based on browser’s language and stores it in paramater $my_search_txt. A string format is used by functions like printf(...) in line 20 to create strings by combining a string format and paramaters.