Last active
December 30, 2015 01:38
-
-
Save kaseybon/7756985 to your computer and use it in GitHub Desktop.
Adds WordPress pagination to child, sibling pages. Will not add pagination to parent pages. Must be used with the Next Page, Not Next Post plugin: http://wordpress.org/plugins/next-page-not-next-post/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Add to page.php ?> | |
<?php if($post->post_parent !== 0) { | |
$nextPage = next_page_not_post(); | |
$prevPage = previous_page_not_post(); | |
if (!empty($nextPage) || !empty($prevPage)) { | |
if (!empty($prevPage)) echo '<span class="previous-sibling">'.$prevPage.'</span>'; | |
if (!empty($nextPage)) echo '<span class="next-sibling">'.$nextPage.'</span>'; | |
} | |
} ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment