Created
May 17, 2018 13:53
-
-
Save djrmom/878b15338cab8675c64657552720bf4d to your computer and use it in GitHub Desktop.
facetwp beaver builder masonry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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