Advertisement
alchymyth

next-page wt title

Jun 5th, 2011
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <?php
  2. $pagelist = get_pages('sort_column=menu_order&#038;sort_order=asc');
  3. $pages = array();
  4. foreach ($pagelist as $apage) {
  5. $thepages[] += $apage->ID;
  6. }
  7.  
  8. $current = array_search($post->ID, $thepages);
  9. $prevID = $thepages[$current-1];
  10. $nextID = $thepages[$current+1];
  11. ?>
  12.  
  13. <div class="navigation">
  14. <?php if (!empty($prevID)) { ?>
  15. <div class="alignleft">
  16. <a href="<?php echo get_permalink($prevID); ?>"
  17. title="<?php echo get_the_title($prevID); ?>">Previous: <?php echo get_the_title($prevID); ?></a>
  18. </div>
  19. <?php }
  20. if (!empty($nextID)) { ?>
  21. <div class="alignright">
  22. <a href="<?php echo get_permalink($nextID); ?>"
  23. title="<?php echo get_the_title($nextID); ?>">Next: <?php echo get_the_title($nextID); ?></a>
  24. </div>
  25. <?php } ?>
  26. </div><!-- .navigation -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement