Skip to content

Instantly share code, notes, and snippets.

@WordBits
Created December 8, 2019 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WordBits/6e3e9c88bbeb00059c4e2618e2609586 to your computer and use it in GitHub Desktop.
Save WordBits/6e3e9c88bbeb00059c4e2618e2609586 to your computer and use it in GitHub Desktop.
Code I got from Joe to do stuff.
<?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