# Pagination with numbers instead of next/previous

**URL:** <https://forum.getkirby.com/t/pagination-with-numbers-instead-of-next-previous/4416>\
**Category:** Questions\
**Tags:** v2\
**Created:** [June 14, 2016, 1:15pm UTC](https://forum.getkirby.com/t/pagination-with-numbers-instead-of-next-previous/4416 "2016-06-14T13:15:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davabo](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@davabo](https://forum.getkirby.com/u/davabo)\
**Post date:** [June 14, 2016, 1:15pm UTC](https://forum.getkirby.com/t/pagination-with-numbers-instead-of-next-previous/4416/1 "2016-06-14T13:15:43Z")

</div>

hey guys,

I have pagination working nicely on my blog.

But I would like to have a list of page numbers instead of the standard next/previous buttons.

How would be this be possible with kirby?

My current code is

```
				<?php if($articles->pagination()->hasPages()): ?>
		<nav class="pagination">
  			<?php if($articles->pagination()->hasNextPage()): ?>
  				<a class="next" href="<?php echo $articles->pagination()->nextPageURL() ?>">Next Page &lsaquo; </a>
  			<?php endif ?>
  			<?php if($articles->pagination()->hasPrevPage()): ?>
  				<a class="prev" href="<?php echo $articles->pagination()->prevPageURL() ?>">Previous Page &rsaquo;</a>
  			<?php endif ?>
		</nav>
	<?php endif ?>

```

Thank you for any help!

---

<div class="post-metadata">

**Author:** ![davabo](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@davabo](https://forum.getkirby.com/u/davabo)\
**Post date:** [June 14, 2016, 1:27pm UTC](https://forum.getkirby.com/t/pagination-with-numbers-instead-of-next-previous/4416/2 "2016-06-14T13:27:49Z")

</div>

If anyone else wants the same thing.

This document here has everything you need.

[https://getkirby.com/docs/cheatsheet/pagination/next-page](https://getkirby.com/docs/cheatsheet/pagination/next-page)

---

<div class="post-metadata">

**Author:** ![Thiousi](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/thiousi/32/13656_2.png) [@Thiousi](https://forum.getkirby.com/u/Thiousi)\
**Post date:** [June 14, 2016, 2:06pm UTC](https://forum.getkirby.com/t/pagination-with-numbers-instead-of-next-previous/4416/3 "2016-06-14T14:06:34Z")

</div>

You can try using `$pagination->toArray()` and then foreach page list it.  
All the pagination helpers are explained here: [https://getkirby.com/docs/cheatsheet#pagination](https://getkirby.com/docs/cheatsheet#pagination)

---

<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:** [June 14, 2016, 2:17pm UTC](https://forum.getkirby.com/t/pagination-with-numbers-instead-of-next-previous/4416/4 "2016-06-14T14:17:07Z")

</div>

If you want to have pagination with a page range, check out this [blog post](https://getkirby.com/docs/solutions/blog/pagination).

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 4:57pm UTC](https://forum.getkirby.com/t/pagination-with-numbers-instead-of-next-previous/4416/5 "2025-02-06T16:57:48Z")

</div>


