• Hey guys, I’m having an odd problem with a theme. I built a custom popular page, nothing fancy. The problem is, that I can just type popular/page/39383 and I won’t get to the error page but instead see the normal sidebar of the page and no posts (obviously I don’t actually have that many pages).

    On a similar issue, My main loop only goes to page 306 even though there are 400. Any ideas on this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • What’s a “custom popular page”?

    Thread Starter Felix

    (@ltse)

    wp_reset_query();
    
    $args = array(
        'category_name' => 'test',
        'posts_per_page' => 12,
        'meta_key' => 'post_views_count',
        'orderby' => 'meta_value_num',
        'order' => 'DESC',
        'paged' => $paged
    );
    
    query_posts($args); while (have_posts()): the_post();

    ^This

    Is this the only query & loop in the template?

    Thread Starter Felix

    (@ltse)

    I have a few other queries before that one on the same page, yes.

    in that case, you shouldn’t be using query_posts(). It should only ever be used to modify the primary/main Loop in a template file – otherwise you will get very unpredictable results. Use WP_Query() instead.

    Thread Starter Felix

    (@ltse)

    Thanks for the advice. Changed all non-main loops to use WP_Query. However, both errors keep occurring.

    They also only appear on the main page and the popular page.

    Can you drop a copy of one of these template files into a pastebin and post the pastebin url here?

    Thread Starter Felix

    (@ltse)

    hmm, sorry can’t make the code public. I doubt that the problem has anything to do with the code surrounding the main query because the same template is also used by the category and tag and search pages and those don’t have the problem. They are using the unmodified query.

    if (have_posts()) : while (have_posts()) : the_post();

    I’m sorry but if I can’t see the code, then I can’t really help. The best anyone could do, in this situation, is make guesses of varying usefulness.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Infinitly many pages’ is closed to new replies.