I have one page (not an article) with n subpages.
In the main page, I need to show max 3 titles of the subpages and insert a pagination for the other.
How can I do that?
This is my simple code now:
<?php
$parent_id = 14; //main page id
$pages = get_pages( array( 'sort_column' => 'menu_order', 'numberposts' => 3, 'child_of' => $parent_id ) );
foreach ( $pages as $page ) : ?>
<div class="item">
<div class="item-title">
<h2><a href="<?php echo get_permalink( $page->ID ); ?>"><?php echo $page->post_title; ?></a></h2>
</div>
</div>
<?php endforeach; ?>
Thanks.
I solved by myself, the solution is to use wp_query() to create a new loop insted of using get_pages().
Here the new code for page title and contentwith pagination by Preeti Dua from Avigma Technology:
not sure,
but try following plugin
http://wordpress.org/extend/plugins/wp-pagenavi/
If you’d like to add subPage title, description or even thumbnail in pagination button you can use the ACP free WordPress plugin: http://wordpress.org/plugins/advanced-content-pagination/