Hide initial results on first page load

Forums › Forums › Search & Filter Pro › Hide initial results on first page load

  • This topic has 7 replies, 2 voices, and was last updated 10 years ago by Anonymous.
Viewing 8 posts – 1 through 8 (of 8 total)
  • Anonymous
    #69959

    Hi there,

    So when someone visits the search page it’s pre-loaded with some initial results. The problem is these results say ‘Page 1 of 3’ or whatever, but there is no older/newer link. Client hates this, and would like to just hide the whole set of results.

    I found this link

    https://support.searchandfilter.com/forums/topic/how-to-not-show-results-in-first-search-translate-older-newer-posts-2/page/2/

    but unfortunately half of it is private, so the actual solution isn’t very clear. Could someone explain how to hide the initial results please?

    Thanks!

    Trevor
    #69961

    The code on this post:

    https://support.searchandfilter.com/forums/topic/how-to-not-show-results-in-first-search-translate-older-newer-posts-2/#post-68157

    Is correct (I have edited it to work. If you use a decent code editor with a dual pane and put the code in that post in one php file and open the standard results.php, you will see the differences, I hope. BTW, I use the free brackets.io editor (from Adobe).

    Anonymous
    #70050

    Thanks! I’ll test it out and report back.

    Trevor
    #70126

    Ok, I will leave this open and wait to hear back from you.

    Anonymous
    #70549

    Hi again 🙂

    What does the 1726 in the 2nd line of that code refer to? Is that a page ID?

    $sf_current_query = $searchandfilter->get(1726)->current_query();

    Anonymous
    #70551

    Ah never mind I figured it out. It’s the ID of the search form! 🙂

    Code is working, thanks!

    Trevor
    #70554

    Can I close the thread then and mark it resolved?

    Anonymous
    #70556

    Yes thanks!

Viewing 8 posts – 1 through 8 (of 8 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.