Possibility, in pagination, to set a different number of posts per page depending on section

Hi guys,

Is there a possibility in pagination to set a different number of posts per page depending on section?

I know that i can set “paginate = number” in global config to set globally the number of post showing per page. I wonder if there is a way to set this parameter depending of sections.

For example i have a section called /blog where i want to show 5 posts per page, but in other section called /offers i want to show 20 post per page. Is there an easy way to acomplish this?

Thank you!

Yes, for each section you can configure your template.

In /layouts/sectionName/list.html

1 Like

The Paginate and Paginator method takes an optional last argument: Number of posts per page.

2 Likes

It works

Thank you bep!

1 Like