Hi all,
I’m having trouble with setting up the pagination on my blog janwillem.net.
The pagination on the blog (homepage) works, but only if I manually type in the address of the website and then add /page:2
When you look at the navigation links at the bottom of the blog, the address is just the homepage of the blog and not /page:2
Here is my home.php code:
<?php snippet('header') ?>
<?php foreach (page('notes')->grandChildren()->listed()->sortBy('date', 'desc')->paginate(2) as $note): ?>
<article>
<?php if($note->toggle() == "true"): ?>
<titel><?= $note->title()->html() ?></titel>
<?php endif ?>
<?= $note->text()->kt() ?>
<date>
<a href="<?= $note->url() ?>">
<?= $note->date()->toDate('Y-m-d') ?>
</a>
</date>
</article>
<?php endforeach ?>
<?php if ($note->pagination()->hasPages()): ?>
<nav class="pagination">
<?php if ($note->pagination()->hasNextPage()): ?>
<a class="next" href="<?= $note->pagination()->nextPageURL() ?>">
‹ older posts
</a>
<?php endif ?>
<?php if ($note->pagination()->hasPrevPage()): ?>
<a class="prev" href="<?= $note->pagination()->prevPageURL() ?>">
newer posts ›
</a>
<?php endif ?>
</nav>
<?php endif ?>
<?php snippet('footer') ?>