Support » Fixing WordPress » Page navigation doesn’t work any more

  • Please help, page navigation doesn’t work on my blog any more. When I go to second page the same posts are shown. Nothing changes. What may cause this? Please help

    Thanks

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

    Most likely you are using a query_posts on that page. Change your query_posts code to include paging

    example:

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

    You must use double quotes, not apostrophes, to surround the query_posts parameters

    @ stvwlf

    That works …. But I have another problem now…

    How do I use your code but exclude categories now?
    I wish to exclude category 7 and 15 for example.

    Can anyone help using code above?

    Kind Regards

    10 minutes later and I just figured it out with trial and error… Just pure guesses and it worked.

    Basically I wrote it like this:

    <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
    query_posts($query_string . ‘&cat=-7,-5&paged=’ . $paged); ?>

    What worked was removing the “amp;” and leaving the “&”…also I placed the “&” in front of the cat.

    It was a pure guess…I really have no clue about php. At least it works now.

    thanks!!!

    I tried both

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts(array(
    		'cat' => 31,
    		'order'=>'DESC',
    		'paged'=>$paged,
    		'posts_per_page' => 10,
    ));

    and

    query_posts($query_string.'&cat='.$catID.'&paged='.$paged.'&posts_per_page='.$maxPosts);

    ($catID and $maxPosts set)

    still I’m taken back to index.php instead of a new category page. the URL is changed, though, to something that mght be correct…

    correction, I get a 404

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Page navigation doesn’t work any more’ is closed to new replies.