Menu go to next child or previous

Hi

I have a list of pages and I’m looking for a way to create a menu to go to the next child in the list or the previous one when visiting a specific page.

Is there anyway to do this?

Appreciate help

You can use the prev()and next() methods:

<nav class="switch-page">
<?php 
if($page->hasPrev()) : ?>
  <a href="<?php echo $page->prev()->url() ?>">Previous Page</a>
<?php endif ?>
<?php if($page->hasNext()): ?> 
  <a href="<?php echo $page->next()->url() ?>">Next Page</a>
<?php  endif; ?>
</nav>

works like a charm.

texnixe I feel like I have to wire money to you soon.

appreciate it.

xx