Masonry

Ajax Load More offers built-in support for rendering Masonry layouts with infinite scroll, however not all Masonry options are available via the shortcode parameters.

Modifying Options

To offer users full control over Masonry settings and options, we’ve added functionality that allows for the passing of custom Masonry options directly to Ajax Load More via JavaScript variables.

To create or override Masonry options, you simply add an alm_masonry_vars JavaScript variable directly to the page template where Masonry is active.

Within the alm_masonry_vars variable you need to specify the key-value pairs you wish to modify (as seen below).

The code sample above adds gutter and columnWidth options, while the itemSelector parameter modifies the value of the masonry_selector shortcode parameter set in the Ajax Load More shortcode.

Note: Not all Masonry options have been tested to work with Ajax Load More, so please use at your own risk.