Sort search with pagination

Highlighted

I need to sort the search with most recent showing first, but this has to work with pagination.

 

{% paginate search.results  by 20 %}
      <div id="AjaxinateLoop" class="grid grid--uniform grid--view-items">
        {% for product in search.results | sort:'price' %}
        {% if product.object_type == 'product' %}
            <div class="grid__item grid__item--{{section.id}} small--one-half medium-up--one-quarter product-item" data-product-type="{{product.type}}">
              {% include 'product-card-grid', max_height: 250 %}
            </div>
        {% endif %}
        {% endfor %}
		</div>
	<div id="AjaxinatePagination">
      {% if paginate.next %}
        <a href="{{ paginate.next.url }}">Loading More</a>
      {% endif %}
    </div>
{% endpaginate %}
0 Likes