<p>Ok, so after discovering the <a href="https://craftcms.com/docs/templating/craft.request#getPageNum" rel="noreferrer">getPageNum</a> request, I found the following solution: </p>

<pre><code>{% set pageNumber = craft.request.getPageNum %}
{% set firstPageLimit = 5 %}
{% set defaultLimit = 8 %}
{% set limit = pageNumber == 1 ? firstPageLimit : defaultLimit %}
{% set offset = pageNumber == 1 ? 0 : firstPageLimit - defaultLimit %}
{% paginate craft.entries.section('news').limit(limit).offset(offset) as articles %}
</code></pre>

CC BY-SA 3.0
2017-05-10T12:09:38.627Z
Whoa, so easy! Thank you for posting this solution.
carlcs
CC BY-SA 3.0
2017-05-10T12:12:14.573Z
Can you please post it here as well: https://craftcms.stackexchange.com/questions/6843/sensible-way-to-have-different-number-of-entries-on-page-one-of-pagination
carlcs
CC BY-SA 3.0
2017-05-10T11:17:34.310Z
2017-05-10T11:17:34.310Z
Mark Notton
<p>This might sound counter-intuitive, but I'm trying to set a specific limit; if the <code>currentPage</code> is the first paginated entry. </p>

<pre><code>{% set limit = paginate.currentPage == 1 ? 5 : 8 %}
{% paginate craft.entries.section('news').limit(limit) as articles %}
</code></pre>

<p>I know this isn't going to work because I'm querying the <code>paginate</code> tag before I've set it. </p>

<p>So is there a way to set a custom limit for the first page only?</p>

<pagination>
Check paginated currentPage before setting the paginate tag
# Check paginated currentPage before setting the paginate tag

(Asked by: username_0 on 2017-05-10)

This might sound counter-intuitive, but I'm trying to set a specific limit; if the currentPage is the first paginated entry. 
{% set limit = paginate.currentPage == 1 ? 5 : 8 %}
{% paginate craft.entries.section('news').limit(limit) as articles %}

I know this isn't going to work because I'm querying the paginate tag before I've set it. 
So is there a way to set a custom limit for the first page only?

**Tags:** pagination


---

## 1 answers

### Answer by username_0 on 2017-05-10. Score: 5 | Accepted answer

Ok, so after discovering the getPageNum request, I found the following solution: 
{% set pageNumber = craft.request.getPageNum %}
{% set firstPageLimit = 5 %}
{% set defaultLimit = 8 %}
{% set limit = pageNumber == 1 ? firstPageLimit : defaultLimit %}
{% set offset = pageNumber == 1 ? 0 : firstPageLimit - defaultLimit %}
{% paginate craft.entries.section('news').limit(limit).offset(offset) as articles %}

> **Comments:**
> **username_1**: Whoa, so easy! Thank you for posting this solution.  
> **username_1**: Can you please post it here as well: https://craftcms.stackexchange.com/questions/6843/sensible-way-to-have-different-number-of-entries-on-page-one-of-pagination  

---

