Archived topic
Change masonry horizontalOrder to true?
3 replies · Started by Addison on December 13, 2021
I'm working on a custom post gallery where the client wants the order of the posts to be as accurate as possible while still using a masonry layout. After a little digging, I've found the Masonry has this option:
https://masonry.desandro.com/options.html#horizontalorder
Does anyone know if there's a way to affect this via a filter? Or even with a little JavaScript? I'm still digging on my own, but I wanted to check and see if someone else has already dealt with this.
Thanks!
-Addison
Hi there,
You should be able to do it like this:
add_filter( 'generate_blog_masonry_init', function( $args ) {
$args['horizontalOrder'] = true;
return $args;
} );
Let us know :)
Thanks, Tom! That did the trick. I didn't see it in the docs, but I should have snooped around in the files a little more. I figured there would be something there.
No problem! Glad I could help :)