Forums Forums Search & Filter Pro Is there a way for the number of search results to show?

Viewing 5 posts - 1 through 5 (of 5 total)
  • Anonymous
    #218426

    Is there a way for the number of search results to show? For example, if I type in “demons” it says “Search results” but it doesn’t tell me how many there are. (ex: 12 results)

    http://162.241.36.122/~achelnst/?sfid=1845&_sf_s=Bible

    Trevor
    #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
    #218449

    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>

    Anonymous
    #218535

    Thanks. Will try this and update if I have any further questions.

    Trevor
    #218551

    OK. I will wait to hear from you.

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