Skip to content

Instantly share code, notes, and snippets.

@mgibbs189
Last active August 27, 2019 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mgibbs189/23a546ebfd4a68dd277003fa81e3e926 to your computer and use it in GitHub Desktop.
Save mgibbs189/23a546ebfd4a68dd277003fa81e3e926 to your computer and use it in GitHub Desktop.
Avada - re-trigger isotope / masonry / packery grid to preserve grid
<?php
// Add the following into functions.php
add_action( 'wp_footer', function() {
?>
<script>
(function($) {
$(document).on('facetwp-loaded', function() {
if (FWP.loaded) {
$grid = $('.fusion-blog-layout-grid');
$grid.isotope('appended', $grid.find('article'));
$grid.imagesLoaded(function() {
$grid.isotope('layout');
});
}
});
})(jQuery);
</script>
<?php
}, 100 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment