-1

I am currently testing the FacetWP trial with two facets on a post archive page, using the WP-show-posts plugin for displaying posts and modal-video.js (https://github.com/appleple/modal-video) for modal functionality. Everything works great until FacetWP sorts the content, after that it breaks all buttons activating the modal-video.js modals.

Here’s a short video of what I mean: https://vimeo.com/349432438

I suspect that by adding a bunch of classes, ids and jquery to the exisiting content/page, FacetWP breaks the already existing scripts that work for the buttons and modals (regarding modal-video.js). But so far I can’t determine where the error is coming from and how I can make the modal plugin work together with FacetWP.

I guess, that since the buttons are inside the content/divs that get refreshed, they are affected once FacetWP does its thing.

I already tried using their documentation from here, disabling auto refresh after every interaction, which does not work: https://facetwp.com/how-to-disable-facet-auto-refresh/

With all the buttons that break, I also checked the console for erros, but no errors or missing instances seems to appear.

Since I am hesistant to fork over 99 dollars just to get to their support line, without guarantuee that the plugin works for me, I am trying my luck here. Maybe someone around here has experience with FacetWP and its refresh function and how it works with other javascript/jquery plugins.

1 Answer 1

0

Try adding this to your JS file. I have the same issue as you described. After I sort, the sorted content contains links with a click function (get data attribute and launch modal to play video) that stops working and no errors. But when I refresh, it works. It might not be as slick with the page refresh, but my function now works.

  $('.facetwp-facet').click(function() {
      setTimeout(function() {
        location.reload();
      },500);
  });
1
  • I'm sorry for the really late reply. I just recently got back to testing and this indeed works! You are right, its not as slick as it can be, but still a better way than removing some of my functionality. Again, thanks a lot! I spent hours trying to find a solution. Although I did not input it into my JS files, but used a conditional statement in my functions.php that triggers it only on that page where FacetWP makes problems. Commented Sep 17, 2019 at 11:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.