Number of Results

Forums › Forums › Search & Filter Pro › Number of Results

Tagged: 

Viewing 2 posts – 1 through 2 (of 2 total)
  • Anonymous
    #233860

    I searched in the docu but couldn’t find a possibility on displaying (search.php) the total number of results?
    And when I view it on page 1 like Viewing results 1-20 of 119
    thanks

    Trevor
    #233863

    You would have to edit that theme file and add the PHP yourself. In turn, that requires that you are working with a child theme (easy to setup if you are not), so you can copy the search.php file to the child theme and edit it there. You would also need to know the name of the results array for the wp_query that your theme runs. This is some typical code as an example:

    Found <?php echo $query->found_posts; ?> Results<br />
    Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?>

    Note that this should be placed inside any Ajax container, otherwise if you do a search that uses Ajax to refresh to results, the numbers would not update.

Viewing 2 posts – 1 through 2 (of 2 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.