• Resolved macekm

    (@macekm)


    First, thank you for the plugin. I really like that the title and caption position is flexible (below, right).

    Titles and captions do not appear in jetpack tiled galleries. In my page above, the first gallery is an ordinary WP gallery, the second with mountain views is the non-functional Jetpack tiled gallery, as is the third*. The fourth is just a map with no link to media file, and the last 5 pictures are using Meow gallery.

    As you can see, I can get alt text and exif data, but not captions or titles. I have tried following things:
    – Disabling Get the image captions from the database: This just makes titles to disappear. [enabled at the moment]
    – In one post, I have found that perhaps Jetpacks square tiles are buggy. I have tested square tiles, tiled mosaic, tiled columns without success.
    – enabling CDN in Jetpack. The lightbox still works, but the problem persists. At the moment disabled. I left the CDN settings for this plugin blank.

    I have checked the source code and the only difference (beside missing “data-lbwps-caption”) is in “<img …>” where URLs in fields “src=” ans “srcset=” start with “https://i0.wp.com/&#8221; (or “i1”, “i2”) instead of “https://&#8221;.

    *The 2nd out of three photos is a duplicate from the first gallery (2nd photo)

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Arno Welzel

    (@awelzel)

    I see. The captions also don’t work on my example page:

    https://wordpress-demo.arnowelzel.de/tiled-gallery-jetpack-as-of-2022-01/

    As a workaround you may add them to the alternative text and enable this as caption source. This will be processed by the frontend code which should work even with Jetpack tiled gallery.

    I’ll have to have a deeper look into this to find out what is going on here. If possible, I’ll provide an update to cope with this.

    Thread Starter macekm

    (@macekm)

    Thank you for a quick response.

    Alt text unfortunately is not enough for me, because I need both title and caption/description. For the moment, I can stick with ordinary galleries.

    Plugin Author Arno Welzel

    (@awelzel)

    It seems I found the issue:

    JetPack may create links to images at a smaller size which does only exist as file but not as attachment, so the real image may not be found in the database. There is already a workaround to deal with this.

    However, WordPress may create “scaled” versions of images during the upload if the image is wider or higher than 2048 pixels. In this case the image meta key for the attachment is not the original file name but a name with the word “-scaled” in it. Example: image is “apple.jpg”, but the scaled version of it will be “apple-scaled.jpg” – and this is also used for the attachment record, so when you insert an image as media element, this scaled version will be used. WordPress will also create intermediate sizes like “apple-1024×768.jpg”.

    Since JetPack has its own logic how to build image URLs two things come together:

    1. JetPack may link to an intermediate size image like “apple-1024×768.jpg”- this is (optionally) fixed by the plugin.
    2. The attachment ID is bot “apple.jpg” but “apple-scaled.jpg” – so there is no attachment record for “apple.jpg”, and thus also no chance to find the caption and title for that attachment.

    In version 5.2.6 I added a workaround to construct several variations of the image name, so the attachment ID query is more robust. At least on my demo page this works now – for all images where there is a caption defined, it will be displayed now:

    https://wordpress-demo.arnowelzel.de/tiled-gallery-jetpack-as-of-2022-01/

    Please try version 5.2.6 and let me know if this works for you as well.

    • This reply was modified 7 months, 3 weeks ago by Arno Welzel.
    Thread Starter macekm

    (@macekm)

    Thank you, it works!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘No titles and captions with Jetpack tiled gallery’ is closed to new replies.