Created
September 30, 2013 20:41
-
-
Save rizkysyazuli/6769957 to your computer and use it in GitHub Desktop.
Kirby CMS Snippets: pagination with page numbers.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? if ($articles->pagination()->hasPages()): ?> | |
<ul class="pagination"> | |
<? if($articles->pagination()->hasNextPage()): ?> | |
<li><a class="prev" href="<?= $articles->pagination()->nextPageURL() ?>">Older posts</a></li> | |
<? endif; ?> | |
<? foreach($articles->pagination()->range(5) as $paging): ?> | |
<li><a href="<?= $articles->pagination()->pageURL($paging); ?>"><?= $paging; ?></a></li> | |
<? endforeach ?> | |
<? if($articles->pagination()->hasPrevPage()): ?> | |
<li><a class="next" href="<?= $articles->pagination()->prevPageURL() ?>">Newer posts</a></li> | |
<? endif; ?> | |
</ul> | |
<? endif; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment