Forums › Forums › Search & Filter Pro › No initial results
- This topic has 2 replies, 3 voices, and was last updated 8 years, 8 months ago by Ross.
-
Anonymous(Private) April 7, 2016 at 7:04 pm #41975
Hi,
I have a question I am hoping has a quick answer that I have missed in the options.
I am trying to put the search/filter box on my page via shortcode and have the results shortcode show up directly underneath. (This is working perfectly)
However, I would like no immediate results to load in the results short code. Meaning, when the page loads, I want the search box to appear with no results (right now, it’s showing all posts, waiting for me to filter.) Is there a way to only have the results shortcode fill when someone selects a filter above? I have content underneath the results, which is why I would like that to show initially in the event that someone doesn’t want to filter the pots.
Thank you very much for your help.
Zach Sykes
803-292-1584
zsykes@octagonsolutions.netTrevor(Private) April 8, 2016 at 9:23 am #42025I have no doubt that it can be done, but I am unsure whether S&F has a code filter/action that allows this, or whether you would need some coding around the shortcode to only place the results conditionally (maybe by examining the url of the page to see if a get query is attached).
Ross may need to answer this, so I will ping him on this query to see if he has any thoughts.
Ross Moderator(Private) April 8, 2016 at 10:26 am #42037Hi Zach
There is no functionality for this built in but if you are able to do some coding this is possible.
Basically you would need to edit your results template and check to see if anything has been filtered before displaying any results (the
have_posts
loop)Hope that helps
Thanks
-
AuthorPosts