# How to paginate gallery

**URL:** <https://discourse.gohugo.io/t/how-to-paginate-gallery/27544>\
**Category:** support\
**Tags:** pagination\
**Created:** [August 12, 2020, 3:43pm UTC](https://discourse.gohugo.io/t/how-to-paginate-gallery/27544 "2020-08-12T15:43:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TenSketch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tensketch/32/9006_2.png) [@TenSketch](https://discourse.gohugo.io/u/TenSketch)\
**Post date:** [August 12, 2020, 3:43pm UTC](https://discourse.gohugo.io/t/how-to-paginate-gallery/27544/1 "2020-08-12T15:43:30Z")

</div>

Hi everyone,  
I have been trying this pagination for the gallery for some time, but not able to achieve it. I’m not sure how to connect .paginator.pages to the below gallery code. I know it is possible. I request someone who is good at understanding Hugo codes to help me out. not able to get the pagination for my gallery:

Under layouts/gallery/single.html I have this code:

```
<div class="container my-5">
    <div class="masonry">
        {{range .Resources.Match "gallery/*" -}}
        {{ $image := . }}
        <div class="masonry-item">
            <a data-fancybox="gallery" href="{{.RelPermalink}}" aria-label="{{.Name}}">
                <img src="{{ $image.RelPermalink }}" class="masonry-content lazyload" alt="{{.Name}}">
            </a>
        </div>
        {{- end }}
    </div>
</div>

```

My WebPage link: [https://www.geotattoos.com/gallery/tattoo-making/](https://www.geotattoos.com/gallery/tattoo-making/)

I tried this code [https://codepen.io/vikrammehta/pen/YjydEM](https://codepen.io/vikrammehta/pen/YjydEM)

My content files:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/gohugo/original/2X/a/ab8e13f3f02ef0dcb4e1c4fb9db9d3eb0e4bc210.png)

Under the gallery/tattoo-making/gallery, I have all the images. I have more than 300 photos which have to be divided into pages. Kindly let me know how can I do it. Thank you!

---

<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:** [August 13, 2020, 12:13am UTC](https://discourse.gohugo.io/t/how-to-paginate-gallery/27544/2 "2020-08-13T00:13:02Z")

</div>

Hi,

Please do not resurrect old posts. The topic you were replying to has been marked solved. If the solution marked does not work for you, then your question should be a new post.

---

<div class="post-metadata">

**Author:** ![TenSketch](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/tensketch/32/9006_2.png) [@TenSketch](https://discourse.gohugo.io/u/TenSketch)\
**Post date:** [August 13, 2020, 4:35am UTC](https://discourse.gohugo.io/t/how-to-paginate-gallery/27544/3 "2020-08-13T04:35:50Z")

</div>

Okay sure! Sorry for that.
