# Need help

**URL:** <https://discourse.gohugo.io/t/need-help/33427>\
**Category:** support\
**Tags:** pagination\
**Created:** [June 17, 2021, 3:26pm UTC](https://discourse.gohugo.io/t/need-help/33427 "2021-06-17T15:26:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jwhevans](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jwhevans/32/14609_2.png) [@jwhevans](https://discourse.gohugo.io/u/jwhevans)\
**Post date:** [June 17, 2021, 3:26pm UTC](https://discourse.gohugo.io/t/need-help/33427/1 "2021-06-17T15:26:39Z")

</div>

I have two main content types on my blog. There are posts and river. Posts are long format while river is just random things I post more regularly. I want the homepage to show only the posts. I cannot get this to work with pagination. I either get empty slots on the page for filtered river items or all items show up. The code below is the partial I use for the main homepage. It currently pulls all items regardless of type although I thought it should filter the posts. Any help would be appreciated. I’m at a loss.

```auto
{{ define "main" }}

  {{ $pages := where site.RegularPages "Type" "posts" }}

  {{ range (.Paginate $pages).Pages }}
      
      <article class="post-list">
      	<header>
        	<h1>
          		{{ .Title }}
        	</h1>
      	</header>
      
      	<div class="content">
        	{{ .Content }}
      	</div>
      
      	{{ partial "articleInfoFull.html" . }}
      </article>
    
  {{ end }}
    
  {{ partial "pagination.html" . }}

{{ end }}

```

---

<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:** [June 17, 2021, 6:32pm UTC](https://discourse.gohugo.io/t/need-help/33427/2 "2021-06-17T18:32:18Z")

</div>

Can you share the repository for your project? There’s nothing wrong with the code you have posted, so we’ll need to look a little deeper. Thanks.

---

<div class="post-metadata">

**Author:** ![jwhevans](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jwhevans/32/14609_2.png) [@jwhevans](https://discourse.gohugo.io/u/jwhevans)\
**Post date:** [June 17, 2021, 6:44pm UTC](https://discourse.gohugo.io/t/need-help/33427/3 "2021-06-17T18:44:05Z")

</div>

> **[jwhevans/mnml.blog](https://github.com/jwhevans/mnml.blog)**
>
> Holds file for mmml.blog. Contribute to jwhevans/mnml.blog development by creating an account on GitHub.

I have pushed all the recent changes.

---

<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:** [June 17, 2021, 7:00pm UTC](https://discourse.gohugo.io/t/need-help/33427/4 "2021-06-17T19:00:30Z")

</div>

This is the problem:  
[https://github.com/jwhevans/mnml.blog/blob/master/layouts/partials/head.html#L9](https://github.com/jwhevans/mnml.blog/blob/master/layouts/partials/head.html#L9)

You are calling `.Paginator`/`.Paginate` twice on the same page. See:  
[https://gohugo.io/templates/pagination/#list-paginator-pages](https://gohugo.io/templates/pagination/#list-paginator-pages)

> For a given **Page** , it’s one of the options above. The `.Paginator` is static and cannot change once created.
> 
> If you call `.Paginator` or `.Paginate` multiple times on the same page, you should ensure all the calls are identical. Once _either_ `.Paginator` or `.Paginate` is called while generating a page, its result is cached, and any subsequent similar call will reuse the cached result. This means that any such calls which do not match the first one will not behave as written.

---

<div class="post-metadata">

**Author:** ![jwhevans](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jwhevans/32/14609_2.png) [@jwhevans](https://discourse.gohugo.io/u/jwhevans)\
**Post date:** [June 17, 2021, 7:07pm UTC](https://discourse.gohugo.io/t/need-help/33427/5 "2021-06-17T19:07:12Z")

</div>

You are correct. That solved the problem. I don’t know if it was technical debt or technical illiteracy 😂. Thank you for your help.

---

<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:** [June 19, 2021, 7:07pm UTC](https://discourse.gohugo.io/t/need-help/33427/6 "2021-06-19T19:07:15Z")

</div>

Closed on June 19, 2021, 7:07pm UTC

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