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)