Custom page loop problem with "Next and Previous Links" at the end of the loop
-
Hi.
I created a loop for parent pages. But i have a problem with nav links at the end of the loop.
When i clik next page it go to https://www.domain.com/page-permalink/page/2 but posts wont’change.
Can someone help me please.
CODE:
<?php if ( have_posts() ) { /* Query and display the parent. */ while ( have_posts() ) { the_post(); the_content(); $thispage=$post->ID; } } ?> <?php $childpages = query_posts('post_per_page=3&orderby=menu_order&order=asc&post_type=page&post_parent='.$thispage); if($childpages){ /* display the children content */ foreach ($childpages as $post) : setup_postdata($post); ?> <h2><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2> <!-- Display the date (November 16th, 2009 format) and a link to other posts by this posts author. --> <small><?php the_time('j. F, Y') ?></small> <?php the_content();?> <hr /> <?php endforeach; } ?> <!-- Nav link Pages --> <div class="navigation"><p><?php posts_nav_link('∞','«« Previous page','Next page »»'); ?></p></div> <!-- Nav links Pages -->
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Custom page loop problem with "Next and Previous Links" at the end of the loop’ is closed to new replies.