Tagged: category, sort, Sortable Masonry Gallery
-
AuthorPosts
-
March 15, 2023 at 5:57 pm #1401282
Dear Support-Team, I am wondering if I could make a Masonry Gallery sortable (as it is possible with the Masonry Blog Post Element). Do you see any chance? I know I can apply categories to images in the media library, can I somehow use them? Or do you have another idea or advice?
Thanks in advance! All the best, Daniel
March 16, 2023 at 12:03 pm #1401361Hey spooniverse,
Thank you for the inquiry.
This option is not available with the Masonry Gallery element, unfortunately. It is possible using Isotope and Shuffle scripts, but it will require modifications that are beyond the scope of support. You will have to use the Masonry element instead and create posts for each image if you want the items to be sortable by categories.
Best regards,
IsmaelMarch 16, 2023 at 4:21 pm #1401387Hi Ismael, thank you for your answer.
I was already thinking about building the gallery with the masonry element. Last year I built a masonry element which opens the posts in lightboxes (see here: https://kriesi.at/support/topic/lightbox-for-blog-post-element/). I had a helping hand from @Guenni007.
All this solution is missing is the navigation from one in a lightbox opened post to the next with some arrows < > as in a normal lightbox gallery. Any idea on how to achieve that?
All the best, Daniel
March 19, 2023 at 5:01 pm #1401690Hi,
To add a navigation arrow to Guenni007‘s script you would add: gallery:{enabled:true} to it like this:function posts_iframe_popup() { ?> <script type="text/javascript"> window.addEventListener('DOMContentLoaded', function() { (function($) { $(' a.av-masonry-entry').magnificPopup({ type:'iframe', gallery:{ enabled:true } }); })(jQuery); }); </script> <?php } add_action('wp_footer', 'posts_iframe_popup');
But this opens the masonry item as an iframe and not the image.
You can change the type to image, but since the image is a background image it will not show in the magnificPopup, I didn’t find a way to get the background image.Best regards,
MikeMarch 29, 2023 at 2:25 pm #1402913Hey Mike, the line
gallery:{ enabled:true }
did the trick. The rest I sorted out with a$('…').remove();
and some styling. Works as intended. Thank you! All the best, Daniel -
AuthorPosts
- The topic ‘Sortable Masonry Gallery’ is closed to new replies.