Support » Themes and Templates » posts_nav_link keeps showing same posts

  • Resolved nipponese


    For some reason when I use posts_nav_link, I keep getting the same posts and it won’t show the older, or new posts.

    Is it a problem that I am using <?php query_posts('category_name=news'); ?> before The Loop?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You need to add some additional code to resolve that.

    Change your query posts to this

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
          query_posts("category_name=news&paged=$paged"); ?>

    make sure you have double quotes around the query_posts parameters

    Thank you!

    I’m having the same problem and I tried this with no avail. Please help.

    This is the page:

    This is my code:

    <div class="articles-container grid_8">
    			$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    			<?php while (have_posts()) : the_post(); ?>
    			<h1><a href="<?php the_permalink(); ?>">
    				<?php the_title_attribute(); ?>
    				<?php meta(subheading); ?>
    			<div class="body-text">
    				global $more;
    				$more = 0;
    				<?php the_content('<p>&raquo; Read full article&hellip;</p>'); ?>
    			<?php endwhile;?>
    			<?php posts_nav_link(' — ', __('&laquo; Newer Posts'), __('Older Posts &raquo;')); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘posts_nav_link keeps showing same posts’ is closed to new replies.