• Resolved jcprovideo

    (@jcprovideo)


    This is for a page template. I am using query posts to display all the posts from a certain category. I have around 70 items in this category, so I want to utilize previous and next to make the page more manageable. The previous and next are working (proceeding to page 2 and beyond), but the page content is not changing. It is still only showing the 6 posts from the first page. Any idea what I am doing wrong? Here is a snippet of my code:

    <?php query_posts('cat=17&posts_per_page=6'); ?>
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
      <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
      <?php endwhile; endif; ?>
    </div>
    <!-- END PORTFOLIO CONTAINER -->
    <div class="previous-and-next"><span class="previous">
      <?php next_posts_link('Next') ?>
      </span><span class="next">
      <?php previous_posts_link('Previous') ?>
      </span></div>
    <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?>
Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter jcprovideo

    (@jcprovideo)

    Any ideas?

    Thread Starter jcprovideo

    (@jcprovideo)

    Nevermind…I fixed it by adding:

    <?php
      $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts("cat=17&posts_per_page=3&paged=$paged");
     ?>

    I love WordPress forums! 🙂

    Where did you put the extra code? I am having exactly the same problem and have tried all sorts of solutions and still can’t fix it!

    Did you put the snippet in your page template or archive.php? I have tried both with no luck. I am using the wp-page-numbers plugin but I have also tried the page-navi plugin and just the plain old:

    <?php next_posts_link('Next') ?>
      <?php previous_posts_link('Previous') ?>

    And nothing seems to work. Here is my page template code:

    <?php // "Section teaser" module begins
    	query_posts('showpost=10&offset=1&cat=3'); ?>
           <?php while (have_posts()) : the_post(); ?>
        <small class="commentmetadata">
        </small> <a href="http://www.wellingtonlivemusic.com/?page_id=4" class="wlm">Reviews</a><a href="<?php the_permalink() ?>" rel="bookmark" class="section-title">
       <?php
    // this is where title of the article gets printed
    	  the_title(); ?>
        </a><br />
        <?php the_excerpt(); ?>
        </a>
        <div class="section-read-on">
        <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php _e('Read More','wyntonmagazine');?></a><div id="spaceex"></div>
        </div>
        <?php endwhile; ?>
    <?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>

    Thanks for any help :~)

    Where did you put the extra code? I am having exactly the same problem and have tried all sorts of solutions and still can’t fix it!

    I’ve got the same question where did you place this code…

    <?php
    $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    query_posts(“cat=17&posts_per_page=3&paged=$paged”);
    ?>

    Anyone? I’d appreciate it so much.

    double post. opps

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Page navigation not working correctly’ is closed to new replies.