• Resolved MGuarino

    (@mguarino)


    Hello all, this is my first post and I’m a novice at php and wordpress in general. I’ve got a minor problem with my code and was hoping for some guidance.

    <?php query_posts('showposts=5' . get_option('posts_per_page=1') . '&paged=' . $paged); ?>
    	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    The above code works perfectly, however when I add the following:

    <?php query_posts('cat=9'); ?>

    The pagination stops functioning. The ability to select only catagory 9 to disply is far more important than the pagination but the pagination would be nice. So why does the following code stop pagnination:

    <?php query_posts('showposts' . get_option('posts_per_page') . '&paged=' . $paged); ?>
    	<?php query_posts('cat=9'); ?>
    	<?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>

    Thanks for any guidance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi

    (@esmi)

    By design, query_posts() stomps over all auto-pagination unless you specifically set it up again. Try:

    <?php query_posts('cat=9&posts_per_page=5' . get_option('posts_per_page=1') . '&paged=' . $paged); ?>

    Michael

    (@alchymyth)

    So why does the following code stop pagnination:

    there is at least a = missing;

    try:

    <?php query_posts('showposts=' . get_option('posts_per_page') . '&paged=' . $paged); ?>

    what template file is that?

    Thread Starter MGuarino

    (@mguarino)

    @esmi
    Your correction worked perfectly. Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Pagination not working?’ is closed to new replies.