Forums › Forums › Search & Filter Pro › "No Results" – Response
- This topic has 9 replies, 2 voices, and was last updated 7 years, 7 months ago by
Trevor.
-
Trevor(Private) February 9, 2018 at 2:29 pm #158573
Hi
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