Pagination in custom temlate
-
hi to all , im having a trouble in adding pagination as<<previous next>> in my template in twentyten theme
<?php $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; $args = array( 'post_type' => 'post', 'posts_per_page' => 9, 'paged' => $paged,); $the_query = new WP_Query( $args ); if ( $the_query->have_posts() ) while ( $the_query->have_posts() ) : $the_query->the_post(); ?> <?php echo the_title(); ?> <?php echo the_content(); ?> <?php endwhile; // end of the loop. ?> <?php if ( $wp_query->max_num_pages > 1 ) : ?> // to show the pagination <div id="nav-below" class="navigation"> <div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav"><< </span>previous', 'twentyten' ) ); ?></div> <div class="nav-next"><?php previous_posts_link( __( 'next<span class="meta-nav"> >></span>', 'twentyten' ) ); ?></div> </div><!-- #nav-below --> <?php endif; ?>
But its not showing any pagination links
any help plzzz…
Thanks
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Pagination in custom temlate’ is closed to new replies.