Alphabetise results and redirect empty search

Forums › Forums › Search & Filter Pro › Alphabetise results and redirect empty search

Viewing 10 posts – 1 through 10 (of 13 total)
  • Anonymous
    #154459

    I’m having a couple of problems.

    When I use the archive.php as a custom template, I can’t get the results to appear in any of the “Default Order” that I choose. I want to alphabetise results. A to Z.

    Also, when a user just clicks the search button without any selection, the non-pro version of the plugin had an empty_search_url setting, but the same thing isn’t working now. Is this feature available?

    Trevor
    #154666
    This reply has been marked as private.
    Anonymous
    #154789
    This reply has been marked as private.
    Trevor
    #154820

    I made a change to enable Auto Count and to remove the secondary sort. Can you check it again now?

    Anonymous
    #154822

    The alphabetisation works now. Great, thanks.

    What about the other issue? Directing an empty search?

    Trevor
    #154839

    Redirecting an empty search is not a feature of the pro plugin, as the plugin is far more complex.

    It IS possible to use PHP to detect if a search has been made though, like this:

    global $searchandfilter;
    $sf_current_query = $searchandfilter->get(1024)->current_query();
    if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) {
      echo '<div>Nothing to see here folks!</div>'; 
    } else {
      // your VC template archive code/loop here
    }
    Anonymous
    #154841

    Is it possible to show all results when an empty search is made?

    Trevor
    #154850

    Does it not do that anyway? It should.

    Anonymous
    #154885

    I realised that it was a WordPress setting I had to only show 10. Thanks for your help.

    Anonymous
    #154889

    Sorry, results are still appearing in order of date.

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