Wordpress | Custom Previous/Next posts

$pagelist = get_pages("child_of=".$post->post_parent."&parent=".$post->post_parent."&sort_column=menu_order&sort_order=asc");
$pages = array();
foreach ($pagelist as $page) {
   $pages[] += $page->ID; 
$current = array_search($post->ID, $pages);
$prevID = $pages[$current-1];
$nextID = $pages[$current+1];

if (!empty($prevID) || !empty($nextID)) { ?>
<div class="navigation-wrapper">
    <div class="navigation">
        <?php if (!empty($prevID)) { ?>
        <div class="cell cell-previous">
            <a href="<?php echo get_permalink($prevID); ?>" title="<?php echo get_the_title($prevID); ?>">
                <strong><?php echo get_the_title($prevID); ?></strong>
        <?php } ?>
        <?php if (!empty($nextID)) { ?>
        <div class="cell cell-next">
            <a href="<?php echo get_permalink($nextID); ?>" title="<?php echo get_the_title($nextID); ?>">
                <strong><?php echo get_the_title($nextID); ?></strong>
        <?php } ?>
My website may contain fan art inspired by existing characters from movies or tv shows, I dont own any rights. Any copyright owner willing to remove those fan arts can contact me here. This is a personal portfolio, the sole use of cookies are for analysing my traffic through Google Analytics, if you're ok with that please accept this terms by closing this disclaimer.