Make the search bar always visible (desktop and mobile)

All Shopify free themes have access to a search functionality: a magnifying glass shaped search icon that when clicked opens a search bar, where you can then type whatever you're looking for and any matching results among your store's products will be shown to you . While a great tool for any store or page in the web, having to click the search icon before revealing the search bar is one click too much and a step that could simply be skipped.

Using this tutorial you'll learn not only how to make the search bar permanently visible and accessible on desktop but also on mobile regardless of the device you're using, using only copy and pasted code that will work on all free themes.

Depending on what version your theme is, you'll need a different approach. Below we cover how to achieve it on the older (7 and below) and newer (7.0.1 and above) of all Shopify's free themes.

Here is a live preview of the end result.

This tutorial is compatible only with Shopify's official free themes: Dawn, Refresh, Colorblock, Taste, Ride, Studio, Crave, Origin, Spotlight, Publisher, Sense & Craft.

Making a backup of your theme

Before diving into the tutorial make sure you download the theme, so in case you face any issues you can easily revert back.

1. Adding the code snippet

  1. Open your Shopify admin and navigate to Online Store > Themes > Actions > Edit Code
  2. Under snippets on the left side, click on “add a new snippet”.
  3. Add a snippet named ezfy-header-search and paste this code inside:



    Creating the ezfy-header-search.liquid snippet file in the code editor
  4. Save the file.
  5. Now open the file named header.liquid
  6. Next we'll implement the snippet into this file.

    To proceed, double check your theme's version to ensure it works correctly.

2.a. Steps for versions above 7.0.1

  1. Open your Shopify admin and click Online Store > Themes > Actions > Edit Code > Snippets > Add a new snippet
  2. Find the file header.liquid and open it
  3. Press CTRL + F (or CMD + F on Mac) to open the search bar and paste exactly this:

    {% render 'header-search'
  4. Delete the line you found.


  5. Paste the following:

    {% render 'ezfy-header-search', input_id: 'Search-In-Modal', device: 'desktop' %}

  6. Now press CTRL + F (or CMD + F on Mac) again to open the search bar and paste exactly this:

     </header>
  7. Paste the following code below the line you found.

    {% render 'ezfy-header-search', input_id: 'Search-In-Modal', device: 'mobile' %}

  8. That is it! You can skip the step 2.b if your theme is above 7.0.1.

2.b. Steps for versions below or equal 7.0.1

In case your theme is below or equal the version 7.0.1, please do the following:

  1. Inside the header.liquid file, press CTRL + F (or CMD + F on Mac) to open the search bar and search for:

    <details-modal class="header__search">

    Paste the following code above the line you found:

    {% include 'ezfy-header-search', device: "desktop" %}

    Finding the location of the header__search in the header.liquid file

    Adding the "include" liquid tag in the header.liquid file
  2. Repeat the search from step 4 but this time click “next” twice to find the second and final instance of the search icon deeper down into the file.

    Again, right above it, paste the following:

    {%- if section.settings.logo_position != 'top-center' -%}
    {% include 'ezfy-header-search', search_type: 'desktop' %}
    {%- endif -%}


    Finding the location of the header__search in the header.liquid file

    Adding the "include" liquid tag in the header.liquid file
  3. Finally, open the search bar a third time and search for the following:

    </header>

    Right below that line, paste the following:

    {% include 'ezfy-header-search', device: 'mobile' %}

    And you're done! Don't forget to click the “save” button on the top right of the screen.

    Finding the header closing tag in the header.liquid file

    Saving the header.liquid file

Conclusion

You and your clients can now search your store more easily with a single click!

Before:

Default search icon in Dawn theme

After:

Always visible search bar in Dawn theme

It works regardless of the logo position you have selected:

Always visible search bar in Dawn theme

Always visible search bar in Dawn theme

And also on mobile:

Always visible search bar in Dawn theme, mobile

If you found any issues during or you'd like your search bar to be customized further, just send us an email at ezfycode@gmail.com and we'll be ready provide further guidance and offer a quote.

You may also like

– How to make slideshow images stop cutting off
– How to add a collection with tabs section to any theme (copy/paste, no apps, blazing fast)

Shop

You may also like

Here are some other blog posts you may be interested in.

Customers'Recommendations

Testimonials

Our clients' satisfaction is our main priority.

Danail Ilev's on Facebook.

DanailIlev

Sofia, Bulgaria

10/10!!! Customization and bug repairs that were impossible for a few previous devs of mine were an easy task for Diego! Honestly cannot recommend him enough. If you like testing different tweaks on your site or have an annoying bug - he's the man. Also his response time is of the charts + same day delivery (Amazon of devs 😁)
Review source
Brogan Domaschenz's on Facebook.

BroganDomaschenz

Australia

VERY VERY IMPRESSED! - understood exactly what i was trying to get across and produced something even better then i could of imagined in a shorter time frame then expected and in a very professional manner. Even though its the festive season, and i needed the coding done urgently, you were quick to respond and get in and get the job done, sacrificing your own holiday time, you absolutely went above and beyond all expectations. I cant recommend you enough!!! 🔥🔥🔥 Top Bloke!
Review source
Mackenzie Dodge's on Facebook.

MackenzieDodge

Colorado, USA

Diego was so easy to work with, I literally had the code to fix the announcement banner on our shopify store in less than 15 minutes! From the time I messaged him on FB to the time I had the code with instructions in my email I barely had time to get coffee! Plus payment was affordable and easy! I wish I had the week back I tried to fix it myself. Will definitely message them FIRST in the future!
Review source
Ibraheem Nadeem's on Facebook.

IbraheemNadeem

Michigan, USA

Diego is amazing at what he does. I've been using his web development services for over a year (I have 20+ projects completed with the EZFY team) and he is always super helpful. His CRO tips are incredible and have definitely helped my conversion rates! Super fast turn around time and always willing to help with support after the project is done. HIGHLY Recommend Diego and the EZFY team for all your Shopify web development needs!
Review source
Anna Dineva's on Facebook.

AnnaDineva

Paris, France

Diego is great ! Very responsive and customizes everything to your wish. Very friendly and comprehensive, + the delivery is immediate. I enjoy a lot working with him ! Recommend 100% !
Review source
Matt Reseigh's on Facebook.

MattReseigh

Adelaide, Australia

Diego was extremely accommodating and easy to work with. He has an extensive amount of knowledge and is willing to go above and beyond. I will certainly be using his services again in the future. Highly recommend!
Review source
Ronny Berco's on Facebook.

RonnyBerco

Toronto, Ontario

Incredible work - I got them to help fix some things on my Shopify store and for such a great price! They were extremely fast and went above and beyond in filling my request. On top of that they made even more great suggestions on fixes I can do for the site. Thanks! Will definitely work with you again.
Review source
Mev Omie's on Facebook.

MevOmie

Melbourne, Australia

One of the best website developers out there! Always on time and exceeds expectations!
Review source
Daniel Walker's on Facebook.

DanielWalker

Melton, Australia

Super happy with Diego’s work! He was quick to help out, easy to communicate with, and finished the work I needed at a very high standard! Thank you Diego!
Review source
Wei Tan's on Facebook.

WeiTan

Australia

Diego is a great resource. He's prompt and highly accommodating, which all leads to a great end result. Highly recommended!
Review source
Shawn Pansiri's on Facebook.

ShawnPansiri

Working with Diego was one of the best experiences I have ever had he is a professional and knows his stuff, anything you ask he will get it done he will also go out of his way and help you out if your knowledge is limited in some areas. One of the best hires I have come across and will hire in a heartbeat. Keep up the good work Diego!
Review source
Jeffrey Richardson's on Facebook.

JeffreyRichardson

Toronto, Ontario

This team went FAR beyond my expectations! It felt as if i had another employee, instead of a service. Their recommendations and exceptional work made my project come out perfectly. Their ability to show me examples, modify at no cost and finish everything extremely fast was amazing. will work with these guys for now on.
Review source
Conny Segervall's on Facebook.

ConnySegervall

Nykarleby, Finland

Hands down the best agency I have ever worked with. Always happy with the awesome results :)
Review source
Richard Agyemang's on Facebook.

RichardAgyemang

Philadelphia, USA

He is the best at what he does. I have worked with a couple of developers but he is by far the best. Thanks for such an amazing job on my site. I 100% recommend him
Review source

Contact Us

Let us know what type of customizations you're looking for.

Send us an e-mail and we'll get back to you within 24 hours! Before you click on "send message" please make sure to do the ReCaptcha so your e-mail can be sent safely.

Loading...