- This topic has 12 replies, 2 voices, and was last updated 9 years, 1 month ago by .
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Search filters no longer work
Hi Trevor,
I found the cause of the problem.
On document load, we run some JS that wraps instances of the ® symbol in <sup> tags:
$("body:contains('®')").html(function (_, html) {
return html.replace(/(®)/g, '<sup>$1</sup>');
});
Commenting out this code makes the filters function again.
We have news posts that have this symbol in its content and some posts that do not. This explains why the filters work on one search and not the initial page load.
As I said before, this code had worked with the filters last year so either something in the plugin’s JS has changed or web browsers have changed its JS behaviour.
Either way, the event listeners on the search filters seem to malfunction due to this DOM update. Can you offer anymore insight into this?
Hi Bill. If the symbols are to be found in posts, maybe try changing it to something like:
$("body .content:contains('®')").html(function (_, html) {
return html.replace(/(®)/g, '<sup>$1</sup>');
});
Or whatever your post container is called, and make sure the form is not inside that?