Inherited a site that uses the gutenberg gallery block and slick to make slideshows. With the WP 5.9 update & new gallery structure, the slideshows got all messed up.
Worked out a way to get the sliders working with the new structure, while retaining the styling and function of the "old" ones (WP is honoring the old structure until a page is updated, so both need to work). Now, the (new) slideshows are displaying the gallery caption as a slide.
When initializing slick, the new gallery goes from a bunch of nested images in a figure with "has-nested-images" class to a bunch of figures within slick divs within the "has-nested-images" class. Thing is, the figcaption is wrapped up in one of the slick divs (the first one, for some reason), listed as "slide00", so it shows as the last slide, rather than being under the gallery.
This is the JS that makes it so both old & new structure galleries work as slideshows. Idk if I should just be relying on styling to pull the captions out, or if there is something I can do with the JS file.
Inherited a site that uses the gutenberg gallery block and slick to make slideshows. With the WP 5.9 update & new gallery structure, the slideshows got all messed up.
Worked out a way to get the sliders working with the new structure, while retaining the styling and function of the "old" ones (WP is honoring the old structure until a page is updated, so both need to work). Now, the (new) slideshows are displaying the gallery caption as a slide.
When initializing slick, the new gallery goes from a bunch of nested images in a figure with "has-nested-images" class to a bunch of figures within slick divs within the "has-nested-images" class. Thing is, the figcaption is wrapped up in one of the slick divs (the first one, for some reason), listed as "slide00", so it shows as the last slide, rather than being under the gallery.
====================================================================
This is the JS that makes it so both old & new structure galleries work as slideshows. Idk if I should just be relying on styling to pull the captions out, or if there is something I can do with the JS file.