How can I sort collection items by publish date, not created date?

@thevault Then also the logic remains the same. use sort filter on collection.products object

 {% assign collection = collection.products | sort: 'published_at'%}
        {% for product in collection %}
          <li class="grid__item grid__item--{{section.id}} {{ grid_item_width }}">
            {% include 'product-card-grid', max_height: max_height %} {{product.published_at | date: "%a, %b %d, %Y"}}
          </li>
     {%endfor%}
1 Like