Forums Forums Search & Filter Pro How to not show all results

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

    Hi again,

    How can I make it so that my search page doesn’t show all the results to begin with?

    -Amin

    Ross Moderator
    #778

    Hey Amin,

    What do you mean exactly, so it displays custom content/message before searching begins?

    Thanks

    Anonymous
    #793

    Yes, exactly. Right now, when I go to my search page, it has all the results by default.

    Ross Moderator
    #795

    Ok this is one I’ve given some thought to…

    Basically.. if a user is using the search form, and then deselects/resets everything – they will expect all the results to be shown – because they haven’t filtered the results by any criteria…

    So changing this in the search form is not recommended.

    I think what you are looking for is a kind of landing page for search – the first time you go on the search page, you will have a custom message with the search form, then the user interacts with the search form and the results begin loading.

    In this case I would recommend the following steps:

    1. Create a new Page where users will begin all their searches.
    2. Make sure this page uses the exact same template as the search results – if you cannot select the page template from the drop down list follow these steps:
      • In your theme folder, duplicate your template and name it something else (by default this is search.php so duplicate search.php and call it search-landing.php.
      • Edit search-landing.php and add this to the top of the file (as per WP Codex here):
        <?php
        /*
        Template Name: My Custom Search Landing Page
        */
        ?>
        
      • Now go back to your page, and you should be able to select a page template called “my custom search landing page” – select this.
      • This will be your landing page – you can modify this template as needed…! You can then perform a search from this page and user will be redirected to the proper search page which will display all (unfiltered) results if desired.

    Let me know how you get on! 🙂

    Anonymous
    #811

    Ok, that’s awesome. Great directions. Let me give it a try and I’ll let you know how it goes.

    Curious, is there a “Reset” button that I can add?

    Ross Moderator
    #812

    Hey Amin there’s not unfortunately – but something I’m working on adding in an update soon (hopefully the next couple of days) 🙂

    Let me know how you get on with the rest.

    Thanks

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