WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a page that list the child pages of this specifiec page but i would like to add pagination for it , how can i do this ?

here is the code that get's the pages

<ul id="products" class="items-thumbs">
            $the_id = get_the_ID();

            $args = array(
            'child_of'     => $the_id,
            'title_li'     => '',
            'parent'       => $the_id,
            'sort_order'    => 'ASC',
            'sort_column'   => 'ID',
            'number'        => 20

            $pages = get_pages( $args );

            $output = '';

            foreach($pages as $value){

                $thumb = get_the_post_thumbnail( $value->ID, $attr = '' );
                $output .= "<li>";
                $output .= "<a href='" . $value->post_name . "' >" . $thumb;
                $output .= $value->post_title . "</a>";
                $output .= "</li>";

            echo $output;
share|improve this question
Take a look at wordpress.stackexchange.com/questions/9233/… is about the same question, basically querying using offset by ajax – Bainternet Feb 20 '11 at 11:21

I think you can use query_posts() function instead of get_pages(), and use a pagination plugin like wp-pagenavi. The query_posts() will set variables for pagination as well without any afforts.

share|improve this answer
thanks i managed to fix it using this code – ahmedelgabri Feb 21 '11 at 10:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.