Forums Forums Search & Filter Pro Total Number of Results

Viewing 6 posts - 1 through 6 (of 6 total)
  • Anonymous
    #108541

    In the post template, the code

    <?php echo $query->found_posts; ?>

    gives the dynamic number of filtered results. However, I would like to get the static total number of posts irrespective of what filters are used. How could I do this?

    many thanks!

    Trevor
    #108556

    Can you use the post_count variable instead of found_posts?

    Anonymous
    #108561

    hmm.. for some reason post_count is returning 24 results although the total number of posts in that filter is 40..

    Anonymous
    #108563

    actually it’s 24 because I chose to display 24 results on one page..

    Trevor
    #108565

    Yes. I just re-read to Codex page for it.

    What you want is something better explained as:

    Found xxx posts after filtering xxx posts

    And I cannot find a WordPress function to do this, so the only way to do it might be horrible; to perform two loops, with the horrendous server load that would cause.

    I am not sure even that would work though.

    Anonymous
    #108567

    ah yes.. it seems difficult which is such a shame. But it’s such a simple and useful thing to have.

Viewing 6 posts - 1 through 6 (of 6 total)