Open
Description
Steps to reproduce the issue
Start with a site where you've enabled the Carousel feature under Jetpack > Settings, and where you've added the AMP plugin and set it to Transitional mode.
- Go to Posts > Add New
- Add some content, and 2 single images.
- Add a link to both of those images, linking to other posts on your site.
- Publish your post.
- On the frontend, you'll notice that when clicking on the images, you're redirected to the other post you linked to.
- Add
?amp
to the post URL. - You'll notice that the first image (and only the first image) now uses an AMP lightbox: instead of linking out to the other post, it opens a lightbox.
This was introduced in #15398, in an attempt to try to replicate Jetpack's Single Image Carousel feature that was introduced in #5469. There are 2 distinct issues here:
- We should only apply the AMP lightbox (in
maybe_add_amp_lightbox()
) when the image links to an attachment page. In the general implementation of the single image carousel feature, this was done via thedata-permalink
attribute, added to the image markup and pointing to the attachment page. Any other link would be ignored. - The AMP lightbox should be applied to all single images on the page, not just the first one.
Original report:
- 3332333-zen
- p9F6qB-5WD-p2
Metadata
Assignees
Labels
Type
Projects
Status
Triaged