# Pagination not being generated

**URL:** <https://zola.discourse.group/t/pagination-not-being-generated/237>\
**Category:** Support\
**Created:** [November 5, 2019, 3:37pm UTC](https://zola.discourse.group/t/pagination-not-being-generated/237 "2019-11-05T15:37:35Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Wychmire](https://yyz2.discourse-cdn.com/free1/user_avatar/zola.discourse.group/wychmire/32/117_2.png) [@Wychmire](https://zola.discourse.group/u/Wychmire)\
**Post date:** [November 6, 2019, 6:17pm UTC](https://zola.discourse.group/t/pagination-not-being-generated/237/8 "2019-11-06T18:17:25Z")

</div>

That works now, but I can’t figure out how to limit it to X posts. It grabs every single one, and I don’t think I can use `paginate_by` to limit it? I tried `{% if loop.index > 5 %}` inside `{% for page in recent_changes.pages %}` but no luck.

**Edit:** I should have been using `<` (less-than), not `>` (greater-than). `{% if loop.index < 5 %}` does what I want!

Based on the stuff above I figured out how to create an archive though! For anyone in the future looking to do the same thing, here’s what I did.

archive.html:

```auto
{% extends "base.html" %}
{% block title %}{{ section.title }}{% endblock title %}
{% block content %}
<h2>News Archive</h2>
<ul>
    {% set recent_changes = get_section(path="news/_index.md") %}
    {% for page in recent_changes.pages %}
    {% if page.date and not page.template %}
    <li>
        {{page.date}} - <a href="{{ page.permalink | safe }}">{{ page.title }}</a>
    </li>
    {% endif %}
    {% endfor %}
</ul>
{% endblock content %}

```

`content/news/archive/_index.md`:

```auto
+++
title = "News Archive"
template = "archive.html"
+++

```

---

_[View the full topic](https://zola.discourse.group/t/pagination-not-being-generated/237)._
