# Maintain number of post in list on Paginate with exclusion

**URL:** <https://discourse.gohugo.io/t/maintain-number-of-post-in-list-on-paginate-with-exclusion/37120>\
**Category:** support\
**Tags:** pagination\
**Created:** [February 12, 2022, 9:18am UTC](https://discourse.gohugo.io/t/maintain-number-of-post-in-list-on-paginate-with-exclusion/37120 "2022-02-12T09:18:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![idarek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idarek/32/26229_2.png) [@idarek](https://discourse.gohugo.io/u/idarek)\
**Post date:** [February 12, 2022, 9:18am UTC](https://discourse.gohugo.io/t/maintain-number-of-post-in-list-on-paginate-with-exclusion/37120/1 "2022-02-12T09:18:32Z")

</div>

Hi,  
I am using the following

```auto
{{ range where .Paginator.Pages "Params.hidden" "ne" "true" }}

```

To list posts on site excluding the ones that have parameter hidden set.

In config `paginate = 10`

Instead of getting 10 pages, I got only 8 on the first page, 10 on the second and then 3rd page is generated with no pages in the list.

I know that simple issue, but I am a bit confused now about how to get this sorted?

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [February 12, 2022, 10:14am UTC](https://discourse.gohugo.io/t/maintain-number-of-post-in-list-on-paginate-with-exclusion/37120/2 "2022-02-12T10:14:06Z")

</div>

Select your pages, _then_ paginate.

```auto
{{ $p := where site.RegularPages "Type" "post" }}
{{ range (.Paginate $p).Pages }}

```

And your boolean comparison should not be quoted:  
`true` instead of `"true"`

---

<div class="post-metadata">

**Author:** ![idarek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/idarek/32/26229_2.png) [@idarek](https://discourse.gohugo.io/u/idarek)\
**Post date:** [February 12, 2022, 11:06am UTC](https://discourse.gohugo.io/t/maintain-number-of-post-in-list-on-paginate-with-exclusion/37120/3 "2022-02-12T11:06:16Z")

</div>

Super. Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [February 14, 2022, 11:07am UTC](https://discourse.gohugo.io/t/maintain-number-of-post-in-list-on-paginate-with-exclusion/37120/4 "2022-02-14T11:07:01Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
