Forums › Forums › Search & Filter Pro › Alphabetise results and redirect empty search
- This topic has 12 replies, 2 voices, and was last updated 6 years, 9 months ago by Trevor.
-
Anonymous(Private) January 24, 2018 at 4:14 pm #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(Private) January 25, 2018 at 12:50 pm #154839Redirecting 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 }
-
AuthorPosts