Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pro: How to re-run masonry when using FacetWP #220

Open
SauntValerian opened this issue May 30, 2020 · 7 comments
Open

Pro: How to re-run masonry when using FacetWP #220

SauntValerian opened this issue May 30, 2020 · 7 comments

Comments

@SauntValerian
Copy link

SauntValerian commented May 30, 2020

Trying to figure out how to rerun your masonry script after FacetWP refreshes a page.

Page I'm working on is here: https://kf.prometheusfire.me/kunst/

The guidance from FWP is here: https://facetwp.com/documentation/developers/javascript/facetwp-loaded/

Here is how it was done with the Beaver Builder masonry, but I can't seem to figure it out for yours https://gist.github.com/djrmom/878b15338cab8675c64657552720bf4d

Here is how it was handled with Avada's Masonry: https://gist.github.com/mgibbs189/23a546ebfd4a68dd277003fa81e3e926

@dudaster
Copy link
Owner

dudaster commented Jun 2, 2020

Next version will come with a do action after Ajax I’ll keep you post it

@dudaster
Copy link
Owner

dudaster commented Jun 2, 2020

You'll need to run this function when on ajax success:

ECS_do_action('ajax','');

@SauntValerian
Copy link
Author

SauntValerian commented Jun 6, 2020

Thanks, resolved!

In this case it was as simple as this

<script>
(function($) {
    $(document).on('facetwp-loaded', function() {
        if (FWP.loaded) {
          ECS_do_action('ajax','');

        }
    });
})(jQuery);
</script>

@kaladinyai
Copy link

How would you suggest we implement this fix? I'm currently experiencing the same issue but not confident when working with code.

@dudaster
Copy link
Owner

You can use html widget from elementor and copy paste it in there.

@kaladinyai
Copy link

Should I paste the code above?

@PPjev
Copy link

PPjev commented Nov 4, 2021

Having same issue with Jet Filters for filtering. How to find the right function to hook in to it? Above code will work only for FacetWP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants