How do I display all of my products on my home page using Shopify and Liquid?

The Unknown Dev picture The Unknown Dev · Aug 14, 2012 · Viewed 10.2k times · Source

Is there a simple snippet of Liquid markup I can use on my index.liquid page (home page) to display all of the products that I have and make each of those images a link to the respective product's information page?

Answer

Caroline Schnapp picture Caroline Schnapp · Aug 17, 2012

Most themes display a collection on their home page. Go with that functionality, don't add code.

For your home page collection to include all products in your store, make it a smart collection with a condition such as Product Price > 0.

If you have more than 50 products in your shop, you can add pagination to your home page by adding Liquid tags to your templates/index.liquid file. For inspiration on how pagination is done in a Shopify theme, look into your templates/collection.liquid file.

There is possibly some limit imposed by your theme on how many products from your homepage collection are shown on your home page. If that's the case, you'll find code that looks like this in your templates/index.liquid file:

{% for product in collections.frontpage.products limit: 12 %}

Remove the limit attribute.