Forums › Forums › Search & Filter Pro › Hide initial results on first page load (continued)
- This topic has 6 replies, 2 voices, and was last updated 8 years, 1 month ago by Anonymous.
-
Anonymous(Private) November 16, 2016 at 2:50 pm #70560
Continued from https://support.searchandfilter.com/forums/topic/hide-initial-results-on-first-page-load/
Sorry, that last thread was closed but I’ve discovered a problem.
The if/else check at the beginning is failing if I’m filtering for a category but the search text filed is empty.
if ((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()=="")) { echo '<div> </div>'; } else
Anonymous(Private) November 16, 2016 at 3:55 pm #70591It looks like this:
http://www.site.com/private/pages/my-pages/advanced-search/?_th_private_page_category=recentnewsI also have tags using a similar URL:
http://www.site.com/private/pages/my-pages/advanced-search/?_th_post_tag=activityAnonymous(Private) November 16, 2016 at 5:17 pm #70658No I’m afraid not, it’s on the client server.
It looks like it might work if I knew how to check for contents of the categories and tags boxes instead of the text search field.
The code you provided looks like ($sf_current_query->get_search_term()==””) checks to see if the text search field is empty. Is there a similar query to check if the categories selection is empty? And the tags selection?
Many thanks.
Trevor(Private) November 16, 2016 at 5:35 pm #70662This thread shows you how to find the different valid term names:
https://support.searchandfilter.com/forums/topic/get-date-range-from-current-archive-php-url/
Using the print array initially to show them, and then you make some PHP to use the name you got.
-
AuthorPosts