Menu

Custom Themes Update - Fix Pagination

For theme versions less than 1.4.1, pagination has a bug with the next and previous links not working correctly. This has been fixed in themes with a version of 1.4.1 or greater. For older themes, the solution is simple. Unless you have made your own customizations to snippets/pagination, you can simply overwrite the contents of the file with the following code:


  

{% comment %}
  This is the pagination list displayed below a list of courses or bundles
{% endcomment %}
{% if paginate.pages > 1 %}
  <div class="text-center">
    <ul class="pagination">
      <li{% unless paginate.previous_page %} class="disabled"{% endunless %}>
        {% if paginate.previous_page %}
            <a href="{{ paginate.previous_page.url }}">&laquo;</a>
        {% else %}
            <span>&laquo;</span>
        {% endif %}
      </li>
      {% for page in paginate.parts %}
        <li{% unless page.is_link %} class="active"{% endunless %}>
          <a href="{{ page.url }}">{{ page.title }}</a>
        </li>
      {% endfor %}
      <li{% unless paginate.next_page %} class="disabled"{% endunless %}>
        {% if paginate.next_page %}
            <a href="{{ paginate.next_page.url }}">&raquo;</a>
        {% else %}
            <span>&raquo;</span>
        {% endif %}
      </li>
    </ul>
  </div>
{% endif %}

  

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.