Support » Fixing WordPress » query_posts breaking next & previous page links navigation

  • Resolved kylegach


    A moderator can delete this please. Sorry for the trouble.

    I was uploading my revised index.php to the wrong theme folder the whole time. Silly me.

    Here is my site:

    I’m using query_posts to exclude some categories from the front page and it seems to have broken the pagination built into WordPress. I’ve read (and implemented) each of the solutions listed here:

    with no luck.

    Here are the two blocks of code I’ve tried:

    Method 1

    $limit = get_option('posts_per_page');
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('showposts=' . $limit . '&paged=' . $paged .'&cat=-6,-8,-9,-10');
    $wp_query->is_archive = true; $wp_query->is_home = false;
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    Method 2

    <?php if (have_posts()) : $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=-6,-8,-9,-10&paged=$paged"); while (have_posts()) : the_post(); ?>

    Neither one works, and I’m quite stumped and would appreciate any help. Please let me know if you need any more information.


  • The topic ‘query_posts breaking next & previous page links navigation’ is closed to new replies.