jetpack icon indicating copy to clipboard operation
jetpack copied to clipboard

Jetpack Carousel does not support HTML5 gallery

Open proudfoot opened this issue 12 years ago • 2 comments

I'm preparing a client site using the Bailey theme by thethemefoundry. The theme implements support for HTML gallery markup like this:

    // HTML5
       add_theme_support( 'html5', array(
                'comment-list',
                'comment-form',
                'search-form',
                'gallery',
                'caption'
        ) );

We are using Jetpack carousel to display images in the clients portfolio posts instead of the slider packaged with the theme. Carousel is ignoring the client's captions because it looks for dl and dd elements when selecting the caption in jetpack-carousel.js on line 874.

As a work around, I've been able to enable display of the captions by editing line 874 to read:

    caption         = src_item.parents('.gallery-item').find('.gallery-caption').html() || ''

Since the default gallery code specifies classes for both selectors, this seemed like a simple way to allow the elements to change.

This isn't anything like tested, and I do not know about reverse compatibility, but hopefully this at least explains a little better what I ran into.

Is my explanation clear enough? If there is any other information I can supply please just say.

proudfoot avatar Nov 17 '14 16:11 proudfoot

Originally from 2001689-t

richardmtl avatar Nov 17 '14 16:11 richardmtl

Also brought up in 2225746-t.

aheckler avatar Jun 16 '15 14:06 aheckler