"No results found for…" replacing the search form
4 years, 2 months ago #13532
Recently I installed WPSOLR plugin for a project and I’m using the default [solr_search_shortcode] to search and display the results. Everything it’s ok until when I have no result, the plugin doesn’t display the form anymore, so I have to refresh the page or go back to the previews search.
Debugging I’ve seen that:
echo “<span class=’infor’>” . sprintf(OptionLocalization::get_term($localization_options, ‘results_header_no_results_found’), WPSOLR_Service_Container::get_query()->get_wpsolr_query(”, true)) . “</span>”;
instead of a template.
There is a way to maintain the search form when no results are returned from search?
Thank you!4 years, 2 months ago #13538
You’re right. It is mandatory to use the Ajax shortcode with multi-domain search. The reason is that the_post() used by your theme will not work, as some posts come from other sites.
Back to your original question then!
The empty results message is taken from the localisations (screen 2.6), in fact the text “Message no results found”. You could use it to add your own text, eventually containing a link/button to the full search url /mysearch/?search=4 years, 2 months ago #13554
Here is a pre-release with a fix: the search form remains visible with empty results. Let me know if it is ok.
You must be logged in to reply to this topic.