Forums › Forums › Search & Filter Pro › Is there a way for the number of search results to show?
Tagged: Show Number of Search Results
- This topic has 4 replies, 2 voices, and was last updated 5 years, 3 months ago by Trevor.
-
Trevor(Private) August 8, 2019 at 10:58 am #218448
You are using the ‘As an Archive’ method, and so will have specified the template to use for the results, which will be a theme template (often either search.php or archive.php, but your setup may be different).
You need to edit that file (or make a re-named copy and use that, preferably in a child theme) and add the PHP code needed to display the message you require. Note that, it should be placed INSIDE the Ajax container you are using, otherwise it will not update when Ajax searches are made.
I do not know what the array variable that your theme uses for the results, but in this example I have assumed this to be $query, but in your theme it could well be different, so do check your theme code if it does not work and edit my code snippet accordingly):
<div class="results-found">Found <?php echo $query->found_posts; ?> Results</div>
Trevor(Private) August 8, 2019 at 10:58 am #218449You are using the ‘As an Archive’ method, and so will have specified the template to use for the results, which will be a theme template (often either search.php or archive.php, but your setup may be different).
You need to edit that file (or make a re-named copy and use that, preferably in a child theme) and add the PHP code needed to display the message you require. Note that, it should be placed INSIDE the Ajax container you are using, otherwise it will not update when Ajax searches are made.
I do not know what the array variable that your theme uses for the results, but in this example I have assumed this to be $query, but in your theme it could well be different, so do check your theme code if it does not work and edit my code snippet accordingly):
<div class="results-found">Found <?php echo $query->found_posts; ?> Results</div>
-
AuthorPosts