Skip to content

Instantly share code, notes, and snippets.

@kyleaparker
Created November 21, 2013 20:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kyleaparker/7588995 to your computer and use it in GitHub Desktop.
Save kyleaparker/7588995 to your computer and use it in GitHub Desktop.
Shopify: Show all numbers in pagination
{% assign count = paginate.pages %}
{% for part in (1..count) %}
<li {% if paginate.current_page == part %}class="active"{% endif %}><a href="{{ collection.url }}?page={{ forloop.index }}">{{ forloop.index }}</a></li>
{% endfor %}
@theamnesic
Copy link

Hi,

I use this filters module to display my products, do you know a way to make it work with your gist ?

Thanks !

— G

@rohitgour45
Copy link

Thanks for the above code.

@IliasDeros
Copy link

While I appreciate this simplistic approach, I found an issue with the search page. Since the search adds a q=search parameter, the query parameter would be lost when changing pages since the href is hardcoded in your example.

I published an updated gist that retains the query parameter by using the generated page.next.url links:
https://gist.github.com/IliasDeros/10cbdf4b6ba9e610ae82d725bff7d56f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment