# Listing posts across sections

**URL:** <https://discourse.gohugo.io/t/listing-posts-across-sections/10250>\
**Category:** Uncategorized\
**Created:** [January 28, 2018, 11:25pm UTC](https://discourse.gohugo.io/t/listing-posts-across-sections/10250 "2018-01-28T23:25:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [January 28, 2018, 11:25pm UTC](https://discourse.gohugo.io/t/listing-posts-across-sections/10250/1 "2018-01-28T23:25:27Z")

</div>

Right now, my theme uses sections to divide content in ‘stories’. The source code is here: [https://github.com/brunoamaral/future-imperfect-DI](https://github.com/brunoamaral/future-imperfect-DI)

The index page lists just the most recent post, and clicking the `next page` link takes you to `posts/page/2`

Of course this does not list content outside of the `/post` folder. How would I go about keeping this behaviour and list all posts in the next page?

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [January 29, 2018, 12:45am UTC](https://discourse.gohugo.io/t/listing-posts-across-sections/10250/2 "2018-01-29T00:45:35Z")

</div>

> [@brunoamaral](#):
>
> Of course this does not list content outside of the /post folder. How would I go about keeping this behaviour and list all posts in the next page?

Which behavior are you referring to? You want to paginate all single pages in the `post` listing?

I am not sure [pagination](https://gohugo.io/templates/pagination/) works like that. You might be able to create a pagination of all content and base it off the home page.

The [paginator pages](https://gohugo.io/templates/pagination/#list-paginator-pages) part of the docs gives clues to where `.Paginator` can be used, and how.

---

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [January 29, 2018, 10:09am UTC](https://discourse.gohugo.io/t/listing-posts-across-sections/10250/3 "2018-01-29T10:09:10Z")

</div>

I was referring to have just one recent post on the homepage and a button to a page that lists all the content.

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [January 29, 2018, 11:42am UTC](https://discourse.gohugo.io/t/listing-posts-across-sections/10250/4 "2018-01-29T11:42:17Z")

</div>

Sorry, not clear enough for me. And I don’t have a test site with content to check the theme. If you want to share a repo, or explain in more detail what you are looking for, I might be able to help. Hopefully someone will come along that gets yer request. 🙂

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [January 29, 2018, 2:11pm UTC](https://discourse.gohugo.io/t/listing-posts-across-sections/10250/5 "2018-01-29T14:11:20Z")

</div>

Can’t test right now, but the way I would go about it would be to skip the pagination from the index.

Have the recent post on the home page as you do. Then point that button to a page where you list everything. `.Site.GetPage` coupled with `where` is the way to do this.

---

<div class="post-metadata">

**Author:** ![brunoamaral](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/brunoamaral/32/21144_2.png) [@brunoamaral](https://discourse.gohugo.io/u/brunoamaral)\
**Post date:** [February 4, 2018, 11:54am UTC](https://discourse.gohugo.io/t/listing-posts-across-sections/10250/6 "2018-02-04T11:54:28Z")

</div>

I’m still trying to figure this out, adapting the code I was using for the homepage isn’t working in the new type of layout:

```
{{ $loop := (where (where .Data.Pages "Type" "!=" "page") ".Params.unlisted" "!=" true ) }}
{{range .Paginate $loop }}
	{{ .Render "summary"}}
{{ end }}

```

This always returns

```
Building sites … ERROR 2018/02/04 11:51:12 Error while rendering "page" in "page/": template: theme/page/allposts.html:19:16: executing "theme/page/allposts.html" at <.Paginate>: error calling Paginate: Paginators not supported for pages of type "page" ("all posts")

```

And every variation either doesn’t return a layout or goes back to an error about Pages not usable in `Paginate`.

What am I missing?
