Forums Forums Search & Filter Pro Search filters no longer work

Viewing 3 posts - 11 through 13 (of 13 total)
  • Anonymous
    #101330

    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?

    Trevor
    #101334

    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?

    Anonymous
    #101347

    I have changed by selector to article:contains which has fixed it.

    Thanks for your help Trevor.

Viewing 3 posts - 11 through 13 (of 13 total)