WordPress.org

Support

Support » How-To and Troubleshooting » page navigation issue

page navigation issue

  • I am using twenty ten theme and am customizing it to make templates for my categories

    This is what I am using to get the posts:

    <?php query_posts("category_name=some_category&paged=$paged"); ?>

    and this is what i’m using to to add next/previous links.

    <div id="nav-above" class="navigation">
    		<div class="nav-previous"><?php next_posts_link( __( '<span class="meta-nav">←</span> Older posts', 'twentyten' ) ); ?></div>
    		<div class="nav-next"><?php previous_posts_link( __( 'Newer posts <span class="meta-nav">→</span>', 'twentyten' ) ); ?></div>
    	</div>

    The pagination links do not show up on the first page, however if I manually go to the next page by appending page/2/ to the url, I see the pagination links on the second page.

    what am I missing?

Viewing 1 replies (of 1 total)
  • Did you set the $paged variable before calling query_posts?

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;?>
    <?php query_posts("category_name=some_category&paged=$paged"); ?>
Viewing 1 replies (of 1 total)
  • The topic ‘page navigation issue’ is closed to new replies.