The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

[resolved] posts_nav_link keeps showing same posts (4 posts)

  1. nipponese
    Posted 7 years ago #

    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?

  2. stvwlf
    Posted 7 years ago #

    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

  3. nipponese
    Posted 7 years ago #

    Thank you!

  4. Hexa6oN
    Posted 7 years ago #

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

    This is the page: http://www.goliathlabs.com/goliath2009/articles/

    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;')); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.