Pagination on tags template


I am trying o include pagination on my tags template but cannot get it working.

So I have the tag {{ range .Data.Pages }} which is pulling in posts tagged with a particular tag. I am trying to combine {{ $paginator := .Paginate (where .Site.RegularPages “Type” “blog”) }} with that, but i might be barking up the wrong tree!

As I have pagination working in my list.html I was trying to get two parts of the code to work together

For example

{{ $paginator := .Paginate (where .Site.RegularPages “Type” “blog”) }}
{{ range .Paginator.Data.Pages }}

Hopefully that will make sense to someone! Thanks a bunch, having lots of fun with Hugo :slight_smile:

Hi there, try this

{{ $paginator := .Paginate (where .Data.Pages "Type" "blog") 10 }}
      {{ range $paginator.Pages }}

but if its not working you have to check your template lookup order

1 Like

Thank you, led me down the right path. I only had to switch my pagination partial for the internal pagination to make it work once I added your code :slight_smile: