Pagination on index/homepage

This script will bring the pagination onto the index/homepage.

theme.liquid

right after {{ content_for_layout }} add the below script:

        {% if template contains "index" %}
          <div id="result"></div>
          <script type="text/javascript">
              $( "#result" ).load( "/collections/frontpage #pagination", function() {
                $(this).appendTo('#product-list > .container');
              });
          </script>
        {% endif %}
change url "/collections/frontpage" to the collection that is on the homepage to pull the correct pagination.

Leave a comment