Try Shopify for free, and explore all the tools and services you need to start, run, and grow your business.

How to Minify Content For Header in Shopify?

 


Shopify does not provide to minify the header content. This code helps you to minify the content of the header.

Step 1: From the Shopify admin panel Click on Online Store ---> Themes

Step 2: Go to the theme editor in which you want to add CSS and javascript then click on Action--->Edit Code

Step 3: Open theme.liquid file from Layout Directory.
In this file search {{content_for_header}} and replace the code by below code

{%- capture content_for_header -%}
{{ content_for_header | replace: '  ', '' | strip_newlines }}
{%- endcapture -%}
{{ content_for_header }}

Step 4:
save the file and check the source code in the browser.



Try Shopify for free, and explore all the tools and services you need to start, run, and grow your business.

How to Minify Content For Header in Shopify? How to Minify Content For Header in Shopify? Reviewed by Navjeet Singh on February 11, 2021 Rating: 5

No comments:

Powered by Blogger.