Skip to content

Instantly share code, notes, and snippets.

@djrmom
Created May 17, 2018 13:53
Show Gist options
  • Select an option

  • Save djrmom/878b15338cab8675c64657552720bf4d to your computer and use it in GitHub Desktop.

Select an option

Save djrmom/878b15338cab8675c64657552720bf4d to your computer and use it in GitHub Desktop.
facetwp beaver builder masonry
<?php
/**
** re-run masonry layout for beaver builder masonry post module after refreshing facets
**/
add_action( 'wp_head', function() { ?>
<script>
(function($) {
$(document).on('facetwp-loaded', function() {
var $element = 'undefined' == typeof element ? $( 'body' ) : $( element ),
msnryContent = $element.find('.masonry');
if ( msnryContent.length ) {
msnryContent.masonry('layout');
}
});
})(jQuery);
</script>
<?php } );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment