Forums › Forums › Search & Filter Pro › "No Results" – Response
- This topic has 9 replies, 2 voices, and was last updated 6 years, 9 months ago by Trevor.
-
Anonymous(Private) February 9, 2018 at 1:34 pm #158554
Hi,
we are using search filter pro on an category-archive page. Everything works fine except one thing: When no results are matching the given filters, it is loading for an eternity and the ajax-response is empty. Nothing changes on the former results, no message that says that there are no results matching the criteria appears.
Could you provide us some help?
Best regards
AdrianTrevor(Private) February 9, 2018 at 2:29 pm #158573Hi
I can see that you are using the ‘As an Archive’ method, which relies on your theme template file, which you will have specified.
As the Ajax refresh is looking for a container with the ID of
article_container
, the template must have its ‘No Results Found` message inside a same named container, which means you would have to edit the template file. To do that safely, you must be working with a child theme and have the edited file in the child theme folder.Trevor(Private) February 9, 2018 at 3:07 pm #158579You are opening the Ajax container outside the start of the IF:
echo '<div id="article_container">'; if (have_posts()) { ?>
But then you end it INSIDE the IF and echo the HTML content there:
}// end while $html_content .='</div>'; //article-container echo $html_content; ?> <?php } else { ?> <!– Why we never come here?! –> <?php echo 'no-results'; ?> <?php } // endif; ?>
Instead try this (but keep a copy of your code):
}// end while <?php } else { ?> <!– Why we never come here?! –> <?php $html_content = 'no-results'; ?> <?php } // endif; ?> $html_content .='</div>'; //article-container echo $html_content; ?>
And, strictly speaking, this line:
echo '<div id="article_container">';
Should be:
$html_content = '<div id="article_container">';
I think.
-
AuthorPosts