Forums › Forums › Search & Filter Pro › No search results
Tagged: no search results
- This topic has 6 replies, 2 voices, and was last updated 4 years, 3 months ago by Trevor.
-
Anonymous(Private) August 20, 2020 at 12:55 pm #256724
Hi there,
doenloaded the plug in and integrated in wordpress step by step the 2 Shortcodes into the page and set the url. I do have categories and want to show them. The plug in shows me all the categories but when I choose one he says there is no result. Any idea to fix it?
Best,
JEnsTrevor(Private) August 20, 2020 at 2:41 pm #256752Two things to check. One, are you hosting with WP Engine? If you are, read here:
https://support.searchandfilter.com/forums/topic/results-not-displaying-3/#post-222308
Second, the form has a number of settings tab. Open the second from last one (Post Meta). Is there a condition set in there, where the last box is empty? user sometimes accidentally add an empty condition, and that would also cause the No Results message. If there is, click Remove.
Anonymous(Private) August 20, 2020 at 4:05 pm #256774Hi Trevor,
Yes second option there was something inside, so good, solved. Now just a quick question. Without doing no search inquiry, it tells me: “Found 608 Results Page 1 of 68”. How can I delete that, because I did not had an inquiry to filter something. Man thanks.Jens
Trevor(Private) August 21, 2020 at 10:42 am #256885I apologise for the delay Jens, I ran out of time yesterday.
If you haven’t already done so, can you follow this guide:
https://searchandfilter.com/documentation/search-results/using-a-shortcode/
In particular, follow the instructions in the Customising section.
That will give you a
results.php
file you can edit, in a sub-folder namedsearch-filter
in your theme folder.Would you want to show that after you search? My guess is yes. So, look for this code in the results.php template file:
Found <?php echo $query->found_posts; ?> Results<br /> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br />
And change that to (I think this will work):
global $searchandfilter; $sf_current_query = $searchandfilter->get(30408)->current_query(); if (!((!$sf_current_query->is_filtered())&&($sf_current_query->get_search_term()==""))) { Found <?php echo $query->found_posts; ?> Results<br /> Page <?php echo $query->query['paged']; ?> of <?php echo $query->max_num_pages; ?><br /> }
You can change anything else you want also. For example, to make the pagination look nicer, install the free WP-PageNavi plugin and delete these lines:
<div class="nav-previous"><?php next_posts_link( 'Older posts', $query->max_num_pages ); ?></div> <div class="nav-next"><?php previous_posts_link( 'Newer posts' ); ?></div>
-
AuthorPosts