Created
December 8, 2019 21:32
-
-
Save WordBits/6e3e9c88bbeb00059c4e2618e2609586 to your computer and use it in GitHub Desktop.
Code I got from Joe to do stuff.
This file contains hidden or 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 | |
// Download this snippet as a plugin and more at: https://wordbits.io/snippet/paginate-pages/ | |
// Created by: Liam Dempsey | |
?> | |
<?php | |
function paginate_child_pages( $post ) { | |
$page_id = $post->ID; | |
$args = array( | |
'post_type' => 'page', | |
'posts_per_page' => -1, | |
'post_parent' => $page_id, | |
'order' => 'ASC', //change to fit your order | |
'orderby' => 'menu_order', //change to fit your order | |
); | |
$child_pages = new WP_Query( $args ); | |
if ( $child_pages->have_posts() ) { | |
$pagination = '<ul class= |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment