• I have a parent page that all of the child pages feed into. I would like to limit it to 10 pages and then add a next/previous link.

    So for example, lets say that I have 30 single pages of content that I show on one single page (see code below) but I would like to limit that to 10 and have 3 pages (previous and next links).

    I’m not sure how to add the links. If anyone could help, that would be awesome.

    Here is my current markup.

    <?php
    // Set up the arguments for retrieving the pages
    $args = array(
    ‘post_type’ => ‘page’,
    ‘numberposts’ => 1,
    ‘post_status’ => null,
    ‘post_parent’ => $post->ID, // $post->ID gets the ID of the current page
    ‘order’ => ASC,
    ‘orderby’ => title,
    );

    $subpages = get_posts($args);
    // Just another WordPress Loop
    foreach($subpages as $post) :
    setup_postdata($post);
    ?>

    <div class=”entry”>

    <div class=”story fRight”>

    <h3><?php the_title(); ?></h3>
    <p><?php $customField = get_post_custom_values(“lookExcerpt”);if (isset($customField[0])) { echo $customField[0]; } ?></p>

    </div>

    <div class=”gallery”>
    <?php the_content(); ?>

    </div>

    </div><!– end .entry –>

    <?php endforeach; ?>

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Pagination with Pages and Child Pages’ is closed to new replies.