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

Viewing 10 posts - 1 through 10 (of 12 total)
  • 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.

    Trevor
    #154891

    That means that your theme is modifying the sort order of the query, possibly by using pre_get_posts(), maybe in the template.

Viewing 10 posts - 1 through 10 (of 12 total)