Pagination not working
-
I’m trying to make a pagination, but it’s not working. The second page aren’t showing any content. What am I doing wrong?
<?php $parent = $post->ID; ?> <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'posts_per_page' => 4, 'paged' => $paged, 'post_parent' => $parent, 'post_type' => $page ); query_posts($args); ?> <?php while (have_posts()) : the_post(); ?> <li><a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail("thumbnail"); ?><br /> <?php the_title(); ?></a></li> <?php endwhile; ?> </ul> <div class="pagination"> <div class="nav-previous alignleft"><?php next_posts_link( 'Older posts' ); ?></div> <div class="nav-next alignright"><?php previous_posts_link( 'Newer posts' ); ?></div></div> <?php wp_reset_query(); ?> </div>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Pagination not working’ is closed to new replies.