Answers.Body: <p>According to your code, I think the issue is that you loop through <code>entries</code> instead of <code>pageEntries</code>.</p>
  <pre><code>&lt;!-- Just set this query once. Rest is done by the paginate tag --&gt;
  {% set entries = craft.entries.section(sectionName) 
      .orderBy('postDate DESC')
      .relatedTo(relatedElement)
      .with ( ['thumbnail'] )
      .limit(10)
  %}
  
  &lt;!-- here you set the paginate query. Use pageInfo for infos of the current page, the pageEntries gives you an object that contains the entries of the current page. So instead of &quot;for entry in entries&quot; you use &quot;for entry in pageEntries&quot; --&gt;
  {% paginate entries as pageInfo, pageEntries %}
  
  &lt;!-- Your pagination as it is, looks fine --&gt;
  {% if pageInfo.totalPages &gt; 1 %}
    &lt;div class=&quot;pagination&quot;&gt;
      ...
    &lt;/div&gt;  
  {% endif %}
  
  &lt;!-- here you should loop through the entries you set in the paginate tag instead of a second query. Use the pageEntries (from {% paginate %}) object instead of entries, to show the entries for this page. --&gt;
  {% for item in pageEntries %}
    &lt;p&gt;{{ item.teaser }}&lt;/p&gt;
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-13T19:03:02.420Z
Answers.Text: That was it! Thanks so much.
Answers.UserDisplayName: 4midori
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-12T07:04:32.120Z
Answers.LastActivityDate: 2022-06-12T07:04:32.120Z
Answers.UserDisplayName: Max Strebel
Body: <p>Craft is no longer handling my pagination properly. This follows an update from somewhere around 3.4 to 3.7.X.</p>
  <pre><code>{% set entries = craft.entries.section(sectionName) 
      .orderBy('postDate DESC')
      .relatedTo(relatedElement)
      .with ( ['thumbnail'] )
      .limit(10)
      %}
  </code></pre>
  <p><strong>sectionName</strong> and <strong>relatedElement</strong> are set earlier in the template. I'm getting correct URLs, like:</p>
  <ul>
  <li>/blog/category/rens-nrens/</li>
  <li>/blog/category/rens-nrens/p2
  and the route I have set up is working, but Craft keeps showing me the first page of results.</li>
  </ul>
  <p><code>{% paginate entries as pageInfo, pageEntries %}</code></p>
  <p><code>...</code></p>
  <pre><code>{% if pageInfo.totalPages &gt; 1 %}
  &lt;div class=&quot;pagination&quot;&gt;
  More:
  &lt;a href=&quot;{{ pageInfo.firstUrl }}&quot; title=&quot;First page of news&quot;&gt;First&lt;/a&gt;
  {% for page, url in pageInfo.getPrevUrls(3) %}
    &lt;a href=&quot;{{ url }}&quot;&gt;{{ page }}&lt;/a&gt;
  {% endfor %}
  
  &lt;span class=&quot;active&quot;&gt;{{ pageInfo.currentPage }}&lt;/span&gt;
  
  {% for page, url in pageInfo.getNextUrls(3) %}
    &lt;a href=&quot;{{ url }}&quot;&gt;{{ page }}&lt;/a&gt;
  {% endfor %}
  &lt;a href=&quot;{{ pageInfo.lastUrl }}&quot; title=&quot;Last page of news&quot;&gt;Last&lt;/a&gt;
  &lt;/div&gt;  
  {% endif %} 
  </code></pre>
  <p>...</p>
  <pre><code>{% set entries = craft.entries.section(sectionName) 
  .orderBy('postDate DESC')
  .relatedTo(relatedElement)
  .with ( ['thumbnail'] )
  .limit(10)
  %}
  
  {% for item in entries %}
  various other bits...
    &lt;p&gt;{{ item.teaser }}&lt;/p&gt;
  
  {% endfor %}
  </code></pre>
  <p>{% paginate entries as pageInfo, pageEntries %}</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-09T07:21:09.717Z
Comments.Text: Can you show the code you use to output the entries? Do you use the `{% paginate entries as pageInfo, pageEntries %}` tag?
Comments.UserDisplayName: Max Strebel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-09T19:52:20.413Z
Comments.Text: @MaxStrebel Yes. I just updated my post with the code.
Comments.UserDisplayName: 4midori
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-09T20:39:08.447Z
Comments.Text: Thanks for updating. But where do you actually output the posts? I'm missing a `{% for entry in pageEntries %} ... {% endfor %}`which actually outputs the entries. what you show is just the pagination, right? On another note: did you try to explicitly set `pageTrigger` in the general config settings? https://craftcms.com/docs/3.x/config/config-settings.html#pagetrigger
Comments.UserDisplayName: Max Strebel
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-10T17:29:21.440Z
Comments.Text: @MaxStrebel I updated the code further, above. I did not set pageTrigger, because I am letting Craft apply its defaults.
Comments.UserDisplayName: 4midori
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-06-12T07:05:28.817Z
Comments.Text: Hey 4midori, thanks for the additional code. I answered with a solution hopefully. On your last comment: while it is good to trust on defaults, you might just want to check once if setting the (`pageTrigger`) parameter explicitly maybe fixes it. In this case thats not the problem, just a thought.
Comments.UserDisplayName: Max Strebel
Tags: <routes><pagination>
Title: Pagination breaking following update to Craft 3.7.X
ThreadText: # Pagination breaking following update to Craft 3.7.X
  
  (Asked by: username_0 on 2022-06-08)
  
  Craft is no longer handling my pagination properly. This follows an update from somewhere around 3.4 to 3.7.X.
  
  ```
  {% set entries = craft.entries.section(sectionName) 
      .orderBy('postDate DESC')
      .relatedTo(relatedElement)
      .with ( ['thumbnail'] )
      .limit(10)
      %}
  
  ```
  
  **sectionName** and **relatedElement** are set earlier in the template. I'm getting correct URLs, like:
  
  * /blog/category/rens-nrens/
  * /blog/category/rens-nrens/p2
    and the route I have set up is working, but Craft keeps showing me the first page of results.
  
  `{% paginate entries as pageInfo, pageEntries %}`
  
  `...`
  
  ```
  {% if pageInfo.totalPages > 1 %}
  <div class="pagination">
  More:
  <a href="{{ pageInfo.firstUrl }}" title="First page of news">First</a>
  {% for page, url in pageInfo.getPrevUrls(3) %}
    <a href="{{ url }}">{{ page }}</a>
  {% endfor %}
  
  <span class="active">{{ pageInfo.currentPage }}</span>
  
  {% for page, url in pageInfo.getNextUrls(3) %}
    <a href="{{ url }}">{{ page }}</a>
  {% endfor %}
  <a href="{{ pageInfo.lastUrl }}" title="Last page of news">Last</a>
  </div>  
  {% endif %} 
  
  ```
  
  ...
  
  ```
  {% set entries = craft.entries.section(sectionName) 
  .orderBy('postDate DESC')
  .relatedTo(relatedElement)
  .with ( ['thumbnail'] )
  .limit(10)
  %}
  
  {% for item in entries %}
  various other bits...
    <p>{{ item.teaser }}</p>
  
  {% endfor %}
  
  ```
  
  {% paginate entries as pageInfo, pageEntries %}
  
  **Tags:** routes, pagination
  
  > **Comments:**
  > **username_1**: Can you show the code you use to output the entries? Do you use the `{% paginate entries as pageInfo, pageEntries %}` tag?  
  > **username_0**: @username_1 Yes. I just updated my post with the code.  
  > **username_1**: Thanks for updating. But where do you actually output the posts? I'm missing a `{% for entry in pageEntries %} ... {% endfor %}`which actually outputs the entries. what you show is just the pagination, right? On another note: did you try to explicitly set `pageTrigger` in the general config settings? https://craftcms.com/docs/3.x/config/config-settings.html#pagetrigger  
  > **username_0**: @username_1 I updated the code further, above. I did not set pageTrigger, because I am letting Craft apply its defaults.  
  > **username_1**: Hey username_0, thanks for the additional code. I answered with a solution hopefully. On your last comment: while it is good to trust on defaults, you might just want to check once if setting the (`pageTrigger`) parameter explicitly maybe fixes it. In this case thats not the problem, just a thought.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-06-12. Score: 2 | Accepted answer
  
  According to your code, I think the issue is that you loop through `entries` instead of `pageEntries`.
  
  ```
  <!-- Just set this query once. Rest is done by the paginate tag -->
  {% set entries = craft.entries.section(sectionName) 
      .orderBy('postDate DESC')
      .relatedTo(relatedElement)
      .with ( ['thumbnail'] )
      .limit(10)
  %}
  
  <!-- here you set the paginate query. Use pageInfo for infos of the current page, the pageEntries gives you an object that contains the entries of the current page. So instead of "for entry in entries" you use "for entry in pageEntries" -->
  {% paginate entries as pageInfo, pageEntries %}
  
  <!-- Your pagination as it is, looks fine -->
  {% if pageInfo.totalPages > 1 %}
    <div class="pagination">
      ...
    </div>  
  {% endif %}
  
  <!-- here you should loop through the entries you set in the paginate tag instead of a second query. Use the pageEntries (from {% paginate %}) object instead of entries, to show the entries for this page. -->
  {% for item in pageEntries %}
    <p>{{ item.teaser }}</p>
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: That was it! Thanks so much.  
  
  ---
  
  