Support » Fixing WordPress » Next Post Links refers to Not Found page

  • Hello,
    I’m writing a custom category template file.
    I have like 20 categories, and like 30 posts a category, so my website is getting pretty slow. I’m trying to solve this with a next_post_link(); but it isn’t working. When i click on the next_page_link(); its refers to Not Found Page.

    This is how I query my post:

    <?php if ( get_query_var('paged') ) {
                                          $paged = get_query_var('paged');
                                        } else if ( get_query_var('page') ) {
                                          $paged = get_query_var('page');
                                        } else {
                                          $paged = 1;
                                        }
                                $args= array(
                                    'cat' => $id,
                                    'posts_per_page' => 10,
                                    'paged' => $paged
                                );
                                query_posts($args); ?>

    $id is the category that I fill in with something like this :

    <?php if (is_category('7')) : ?>
                        <?php $id = 7 ; ?>
     <?php endif; ?>

    Thanks in advance!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Next Post Links refers to Not Found page’ is closed to new replies.