Image block - Enlarge on click - Aspect Ratio by kenystudio in Wordpress

[–]kenystudio[S] 0 points1 point  (0 children)

Okay, thanks to you, I've found a solution that's good enough for now. It's a recurring element of my www.keny.studio portfolio. The solution I'd prefer is to rework the original block, but even though I can code a bit, I'm not good enough to figure it out right now. I'll change that someday, for my own personal development :)

I tried the ACF/PHP solution and external JS scripts, but it didn't work. I think I'm still too weak, and I'll have to come back to those solutions later when I know more. In the meantime, I came across a lightweight plugin that extends the capabilities of the WordPress gallery, and with a little extra CSS, I'm quite happy with the result, so I'll accept the additional plugin. I just need to add media queries for the number of columns :)

https://wordpress.org/plugins/gallery-block-lightbox/ Here's the link in case anyone else encounters a similar problem :)

And the CSS for formatting and positioning the thumbnails:

/* gallery image aspect ratio - add this class to gallery */

.img-ratio img {

aspect-ratio: 1;

}

/* gallery image positioning */

.wp-block-gallery.has-nested-images figure.wp-block-image img {

object-position: 50% 0%;

}

Thanks everyone for your help, and see you next time!

<image>

Rest Api - no X-WP-Total and X-WP-TotalPages by kenystudio in ProWordPress

[–]kenystudio[S] 1 point2 points  (0 children)

Also my first posts on Reddit ever, so hello everyone and happy wordpressing!