• Resolved rjoshicool

    (@rjoshicool)


    In my wordpress theme, whenever I click on the Next or Previous button, I get the same entries on each page. I am using this piece of code for getting the posts –

    \\ <?php query_posts(‘cat=13,14,15,16,17,18,22&showposts=5’); ?>
    \\ <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    \\
    \\ <div class=”post” id=”post-<?php the_ID(); ?>”>

    How can i get this problem solved?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Your code is ignoring the existing query_string. Try:
    query_posts($query_string . '&cat=13,14,15,16,17,18,22&showposts=5');

    Thread Starter rjoshicool

    (@rjoshicool)

    i am not using any query_string yet.. Tried this but not working..

    What Murmatron 2 means is that in this part of your code: <?php query_posts('cat=13,14,15,16,17,18,22&showposts=5'); ?>

    you should remove the part that says showposts=5. You are telling WP that you only want to show 5 posts. I had this problem recently and had to remove it from the index page. You can go to wp-admin/options-reading.php to change “Blog pages show at most” to 5. That worked for me.

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    No, t3ch33, Murmatron 2 didn’t mean anything of the sort. He said exactly what he meant.

    Change this code:
    <?php query_posts('cat=13,14,15,16,17,18,22&showposts=5'); ?>

    To this:
    <?php query_posts($query_string.'&cat=13,14,15,16,17,18,22&showposts=5'); ?>

    Problem solved.

    Thread Starter rjoshicool

    (@rjoshicool)

    thank you all for your comments and help.
    Finally i got the problem solved.
    I had to remove that showposts thing from my code and add an extra paged variable.

    had the same problem,
    thanks for the solution!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Next Previous navigation problem’ is closed to new replies.