Support » Fixing WordPress » Next/Previous Not Working – Not a general settings issue.

  • I’m using this for my site so it only gets posts to display on my index that are in a certain category.

    <?php query_posts('cat=3'); if ( have_posts() ) : while ( have_posts() ) : the_post()?>

    Now my pagination doesn’t work and I don’t know of a way to fix this, I looked up this but it only caused php errors. http://www.rizwanashraf.com/2009/01/24/wordpress-nextprevious-page-links-problem-query_post-pagination-problem/

    Also my general settings have the correct URL (it’s on the root plus it’s not a 404 error) – I’ve looked up this issue and can’t find any related answers.

    When you click next/previous pages it shows the current ones that are already visible on every page so it doesn’t display new ones on either page, just the same 20ish or so on every page.

    Please help! Thank you very much

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi

    change your code to this – should take care of it

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
       query_posts("cat=3&paged=$paged");
       if ( have_posts() ) : while ( have_posts() ) : the_post()?>

    You’re a great help, Thank you so much. It looks similar to the link I had provided but I knew it couldn’t be correct but didn’t know how to fix it! Thank you thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Next/Previous Not Working – Not a general settings issue.’ is closed to new replies.