# Paginator seems to ignore the count of items to be displayed

**URL:** https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088
**Category:** support
**Tags:** pagination
**Created:** [March 19, 2020, 2:05pm UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088 "2020-03-19T14:05:21Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![tipografia](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tipografia](https://discourse.gohugo.io/u/tipografia)
#### Post date: [March 19, 2020, 2:05pm UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088/1 "2020-03-19T14:05:22Z")

</div>

I’d like to have in my home page a fixed number (in the example given, 6) of posts I’ve committed to my website. To do this and in the same time ignore any possible draft, I’ve used this following piece of code since 0.63 version.

```
 {{ range where (.Paginator 6).Pages ".Draft" false }}
 ....
{{ end }}

```

In the compilation, it seems Paginator totally ignore the number 6 and prints only four posts. I’ve read that paginator function might be deprecated but I never received any warning about it. I have tried to edit the number, but it seems it does not affect anything.

I’ve ran my website using the latest version of hugo at the time of writing and my page only had 4 posts, not six as I wanted.

It’s a custom basic theme (the piece of code is taken from `theme/my/index.html`) which I can not release due to NDA filled for my organization. No particular or relevant issues is being showed using `--verbose` flag.

---

<div class="post-metadata">

### Author: ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)
#### Post date: [March 20, 2020, 5:18am UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088/2 "2020-03-20T05:18:51Z")

</div>

Hi there,

Please read [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132) to see what information we need to be able to help.

---

<div class="post-metadata">

### Author: ![tipografia](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tipografia](https://discourse.gohugo.io/u/tipografia)
#### Post date: [March 20, 2020, 1:25pm UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088/3 "2020-03-20T13:25:43Z")

</div>

I’ve included all the information. If any is missing, please expand “information we need”. Thanks

---

<div class="post-metadata">

### Author: ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)
#### Post date: [March 20, 2020, 1:39pm UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088/4 "2020-03-20T13:39:18Z")

</div>

It’s in [Requesting Help](https://discourse.gohugo.io/t/requesting-help/9132) :

> [@](#):
>
> ### Let us see your code
> 
> Include a **link to the source code repository** of your project, because we really need the _context_ of seeing your templates and partials to be able to help you. It is trivial to do a quick `git clone` on your repo, then run `hugo server` in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
> 
> If you can’t share your repository for whatever reason, consider creating a dummy repo that you _can_ share, which reproduces the problem you’re experiencing.
> 
> Git repository hosting services include [Github](https://github.com), [Bitbucket](https://bitbucket.org/), [Codebase](https://www.codebasehq.com), [Gitlab](http://gitlab.com/), [Sourcehut](https://sourcehut.org), and others. If you select Github, even if you do not know `git` or have a repository, you can use Github “gists” for pasting logs and files. You can include multiple files in a single gist, like [this one](https://gist.github.com/RickCogley/2f0d21144e5f3091e62a6ced211c71f3).
> 
> ### Are you using a theme?
> 
> Consider contacting the theme’s author, if it is a theme-specific question because often the author will know better than the random passer-by in the forum. Check the theme’s README. But at least include a link to the theme, to help a person trying to help you.
> 
> ### Include Output and Environment Details
> 
> First, use the `--verbose` switch on `hugo server` to produce more details on the command line including about errors.
> 
> Include the output of `hugo env` from the command line, and any other relevant versions.

---

<div class="post-metadata">

### Author: ![Chris8920](https://avatars.discourse-cdn.com/v4/letter/c/4491bb/32.png) [@Chris8920](https://discourse.gohugo.io/u/Chris8920)
#### Post date: [March 20, 2020, 4:05pm UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088/5 "2020-03-20T16:05:01Z")

</div>

Do you have any pages in addition to the posts?

---

<div class="post-metadata">

### Author: ![tipografia](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tipografia](https://discourse.gohugo.io/u/tipografia)
#### Post date: [March 20, 2020, 8:38pm UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088/6 "2020-03-20T20:38:54Z")

</div>

I have:

- “home” aka / (index.html template of my theme that contains that code snippet I posted)
- posts/ (list of all the posts)
- post/:slug

---

<div class="post-metadata">

### Author: ![pointyfar](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/pointyfar/32/5797_2.png) [@pointyfar](https://discourse.gohugo.io/u/pointyfar)
#### Post date: [March 21, 2020, 1:50am UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088/7 "2020-03-21T01:50:31Z")

</div>

Again:

> [@pointyfar](#):
>
> ### Let us see your code
> 
> Include a **link to the source code repository** of your project, because we really need the _context_ of seeing your templates and partials to be able to help you. It is trivial to do a quick `git clone` on your repo, then run `hugo server` in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
> 
> If you can’t share your repository for whatever reason, consider creating a dummy repo that you _can_ share, which reproduces the problem you’re experiencing.

Otherwise, the answer is: it all works on my site, I don’t know what’s wrong with yours.

---

<div class="post-metadata">

### Author: ![tipografia](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tipografia](https://discourse.gohugo.io/u/tipografia)
#### Post date: [March 21, 2020, 9:05am UTC](https://discourse.gohugo.io/t/paginator-seems-to-ignore-the-count-of-items-to-be-displayed/24088/8 "2020-03-21T09:05:16Z")

</div>

Again I can not publish the source code since all the code I wrote is under NDA.
