"Next" button on "get pages" page
-
Hello!
I’m currently using this code to show all the immediate children of a certain page on the website:
<?php $mypages = get_pages( array( 'child_of' => $post->ID, 'parent' => $post->ID, 'sort_column' => 'post_date', 'sort_order' => 'desc' ) ); foreach( $mypages as $page ) { $excerpt = $page->post_excerpt; if ( ! $excerpt ) // Check for empty page continue; $excerpt = apply_filters( 'the_content', $excerpt ); ?> <br /> <h2><a href="<?php echo get_page_link( $page->ID ); ?>"><?php echo $page->post_title; ?></a></h2> <div class="entry"><?php echo $excerpt; ?></div> <br /> <hr /> <?php } ?>
I’m essentially using it to create a “blog” made up of pages (all the children of the page containing this code.) Now, the question is, I want to only show 5 of the pages at a time, and have a “View More” or “View Previous” or even better, a “1 2 3 4…12” nav-type button at the bottom.
How do I do this?
Thanks!
John-Andrew
- The topic ‘"Next" button on "get pages" page’ is closed to new replies.