# Pagination Broken

**URL:** <https://forum.getkirby.com/t/pagination-broken/25201>\
**Category:** Questions\
**Tags:** v3\
**Created:** [April 6, 2022, 3:22pm UTC](https://forum.getkirby.com/t/pagination-broken/25201 "2022-04-06T15:22:11Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esty\_Engel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/esty_engel/32/11736_2.png) [@Esty\_Engel](https://forum.getkirby.com/u/Esty_Engel)\
**Post date:** [April 6, 2022, 3:22pm UTC](https://forum.getkirby.com/t/pagination-broken/25201/1 "2022-04-06T15:22:11Z")

</div>

I have a gallery with pagination on my website ([On Point Window Treatment](http://onpointwindowtreatment.com/gallery)), but something is off. When I click next, it takes me to the homepage (even manually adding to the URL /page:2 takes home). The odd thing is that it works when I select a filter.

This is what my code looks like:

```auto
<div class="wrapper">
		  		<?php
		  			$projects = $page->children();
			  		if($tag = param('tag')) {
						  $projects = $projects->filterBy('tags', $tag, ',');
						}
		  			$count = 0; 
						foreach($projects_pages = $projects->paginate(10) as $project) { 
		  				$count ++;
					?>
					  <li <?php if($count % 5 == 1){ ?>class="large"<?php } ?> >
					    <a href="<?= $project->url() ?>">
					    	<div class="image-wrapper">
							  	<?php if($image = $project->cover()->toFile()): ?>
								  	<?php if($count % 5 == 1): ?>
										  <img src="<?= $image->crop(1006, 768)->url() ?>" alt="">
										<?php else: ?>
										  <img src="<?= $image->crop(1342, 1480)->url() ?>" alt="">
										<?php endif ?>
									<?php endif ?>
					    	</div>
					    </a>
				    	<div class="info">
					      <h3><?= html($project->title()) ?><br><?= html($project->subtitle()) ?></h3>
					      <div class="excerpt"><?= $project->text()->kt() ?></div>
					      <a href="<?= $project->url() ?>" class="btn dark arrow">Learn More <svg xmlns="http://www.w3.org/2000/svg" width="27.981" height="14.587" viewBox="0 0 27.981 14.587"><path id="Path_49" data-name="Path 49" d="M22,9a1,1,0,0,0,0,1.42l4.6,4.6H3.06a1,1,0,1,0,0,2H26.58L22,21.59A1,1,0,0,0,23.41,23l6.36-6.36a.88.88,0,0,0,0-1.27L23.42,9A1,1,0,0,0,22,9Z" transform="translate(-2.06 -8.704)" fill="#fff"/></svg></a>
					    </div>
					  </li>
					<?php
					  }
	  			?>
				</div>
				<div class="wrapper nav-wrapper">
					<?php if ($projects_pages->pagination()->hasPages()): ?>
						<nav class="pagination">

						  <?php if ($projects_pages->pagination()->hasNextPage()): ?>
						  <a class="next btn" href="<?= $projects_pages->pagination()->nextPageURL() ?>">
						    Next
						  </a>
						  <?php endif ?>

						  <?php if ($projects_pages->pagination()->hasPrevPage()): ?>
						  <a class="prev btn" href="<?= $projects_pages->pagination()->prevPageURL() ?>">
						    Previous
						  </a>
						  <?php endif ?>

						</nav>
					<?php endif ?>
				</div>

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 6, 2022, 3:25pm UTC](https://forum.getkirby.com/t/pagination-broken/25201/2 "2022-04-06T15:25:34Z")

</div>

Which Kirby version are you using? We had an issue in 3.6.3 that was fixed in 3.6.3.1?

---

<div class="post-metadata">

**Author:** ![Esty\_Engel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/esty_engel/32/11736_2.png) [@Esty\_Engel](https://forum.getkirby.com/u/Esty_Engel)\
**Post date:** [April 6, 2022, 3:44pm UTC](https://forum.getkirby.com/t/pagination-broken/25201/3 "2022-04-06T15:44:04Z")

</div>

I’m actually not sure. How would I upgrade?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 6, 2022, 3:54pm UTC](https://forum.getkirby.com/t/pagination-broken/25201/4 "2022-04-06T15:54:15Z")

</div>

> [@Esty\_Engel](#):
>
> I’m actually not sure.

You can see your version in the Panel, in the System’s view. If your issue is caused by the regression introduced in 3.6.3, then you should be on 3.6.3. I would like to verify this before investing time on looking into other potential issues.

---

<div class="post-metadata">

**Author:** ![Esty\_Engel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/esty_engel/32/11736_2.png) [@Esty\_Engel](https://forum.getkirby.com/u/Esty_Engel)\
**Post date:** [April 6, 2022, 3:55pm UTC](https://forum.getkirby.com/t/pagination-broken/25201/5 "2022-04-06T15:55:12Z")

</div>

Yes. The version is 3.6.3

---

<div class="post-metadata">

**Author:** ![Esty\_Engel](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/esty_engel/32/11736_2.png) [@Esty\_Engel](https://forum.getkirby.com/u/Esty_Engel)\
**Post date:** [April 6, 2022, 3:55pm UTC](https://forum.getkirby.com/t/pagination-broken/25201/6 "2022-04-06T15:55:56Z")

</div>

I updated it and it works now. Thank you so much!

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [April 6, 2022, 3:56pm UTC](https://forum.getkirby.com/t/pagination-broken/25201/7 "2022-04-06T15:56:29Z")

</div>

Great!
