Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pagelist = get_pages('sort_column=menu_order&sort_order=asc');
- $pages = array();
- foreach ($pagelist as $apage) {
- $thepages[] += $apage->ID;
- }
- $current = array_search($post->ID, $thepages);
- $prevID = $thepages[$current-1];
- $nextID = $thepages[$current+1];
- ?>
- <div class="navigation">
- <?php if (!empty($prevID)) { ?>
- <div class="alignleft">
- <a href="<?php echo get_permalink($prevID); ?>"
- title="<?php echo get_the_title($prevID); ?>">Previous: <?php echo get_the_title($prevID); ?></a>
- </div>
- <?php }
- if (!empty($nextID)) { ?>
- <div class="alignright">
- <a href="<?php echo get_permalink($nextID); ?>"
- title="<?php echo get_the_title($nextID); ?>">Next: <?php echo get_the_title($nextID); ?></a>
- </div>
- <?php } ?>
- </div><!-- .navigation -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement