How to not show all results

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)

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.