Grandchild pages summary with pagination
-
I am having a page named English and it is having some more subpages like Alphabets and Numbers, Alphabets having subpages as A, B, C, D, E, F, G, H, I, J and Numbers is having 1, 2, 3, 4, 5, 6, 7, 8, 9, 10. The requirement is to display all grand child pages in English with pagination, I did manage to display all the grand children pages title, excerpt (Using functions) and first image of the content with read more link but without pagination using the following codes.
<?php $pages = get_pages('child_of='.$post->ID.'&sort_column=post_date&sort_order=desc'); $count = 0; foreach($pages as $page) { $content = $page->post_excerpt; if(!$content) continue; if($count >= count($pages)) break; $count++; $content = apply_filters('the_content', $content); ?> <div class="alternativerow"><h2><a href="<?php echo $page->guid; ?>"><?php echo $page->post_title ?></a></h2> <div class="casethumb"><img src="<?php $first_img = ''; ob_start(); ob_end_clean(); $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $page->post_content, $matches); $first_img = $matches [1] [0]; if(empty($first_img)){ //Defines a default image $first_img = "/images/default.jpg"; } echo $first_img; ?>" /></div> <?php echo $content ?><a href="<?php echo $page->guid; ?>">Details</a> </div>
Can someone please help me in putting pagination to this?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Grandchild pages summary with pagination’ is closed to new replies.