SITE MAP

  • Create a New Page Called Sitemap:

    • Go to your Shopify admin panel.

    • Click on Online Store > Pages.

    • Click the Add page button.

    • Enter "Sitemap" as the title.

    • Leave the content area blank for now.

    • Click Save.

  • Create a New Template:

    • Go to Online Store > Themes.

    • Click on the Actions button next to your current theme and select Edit code.

    • In the left sidebar, scroll down to the Templates section and click on it.

    • Click Add a new template.

    • In the dialog that appears:

      • Choose page as the template type.

      • Name the template site-map (this will create a file named page.site-map.liquid).

    • Click Create template.

  • Add the Code to the New Template:

    • In the code editor, find the newly created page.site-map.liquid file under Templates.

  • Replace any existing code in page.site-map.liquid with the following code:

<!--
MIT License

Ecomify - Shopify Theme Customization
-->

<div class="container" style="margin-top: 30px; margin-bottom: 30px;">
  <div class="row justify-content-center">
    <div class="col-md-3 mb-4 text-center">
      <h3 class="text-primary">Collections</h3>
      <ul class="list-group">
        {% for c in collections %}
          <li class="list-group-item rounded">
            <a href="{{ c.url }}">{{ c.title }}</a>
          </li>
        {% endfor %}
      </ul>
    </div>
    <div class="col-md-3 mb-4 text-center">
      <h3 class="text-primary">Products</h3>
      <ul class="list-group">
        {% for product in collections.all.products %}
          <li class="list-group-item rounded">
            <a href="{{ product.url }}">{{ product.title }}</a>
          </li>
        {% endfor %}
      </ul>
    </div>
    <div class="col-md-3 mb-4 text-center">
      <h3 class="text-primary">Pages</h3>
      <ul class="list-group">
        {%- for p in pages -%}
          <li class="list-group-item rounded"><a href="{{ p.url }}">{{ p.title }}</a></li>
        {%- endfor -%}
      </ul>
    </div>
  </div>
</div>

Last updated