Search: Add a search bar to your homepage

This tutorial will allow you to display a search bar as a section on your homepage. 



Create a new section file

Open your Code Editor:

In the Sections folder, choose Add a new section:

Call the file:



Use the Create section button to complete.

Delete all the default code that's generated:


Replace with all this code:

Click to view code

Save the file.


Add the section in the Theme Editor

Customize your theme:

Add the new section:

At the bottom, in the text group, add the Search section:

Save your section settings in the Theme Editor

Customize the placeholder text

To customize the placeholder text "Search our store", use the Language Editor. You can easily open the Language Editor from the Theme actions button at the bottom of the Theme Editor:

Once in the Language Editor, use the filter bar (1) and find the Search Placeholder text (2). Change the text there: