• I recently updated and rebuilt my homepage, yet I don’t seem to get a hang of the new image captions / labels / title attributes in the gutenberg editor .. On my old version of the homepage I used a combination of the “title” and “description” that would both show up, styled differently (in a meanwhile deprecated jquery lightbox plugin).

    With the new version of wordpress and your plugin, it seems, that none of those media attributes get displayed in the lightbox… even with the according option boxes checked (get caption from the database).

    The only captions that will show up in the lightbox are the ones in the figcaption of the thumbnails – however, I rarely want captions underneath thumbnails, only in the lightbox (or I’d like to have different captions underneath the thumbnail than the full images).

    … any help would be appreciated!
    thanks in advance.

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

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

    (@awelzel)

    I see that your images don’t use the regular path /wp-content/uploads/... but /media instead. In this case the plugin has no chance to get the captions from WordPress if you did not customize your WordPress installation so it will find image metadata using /media as well.

    Technical background:

    If the caption can not be found in the HTML code (figcaption, alt attribute in the image etc.) Lightbox with PhotoSwipe tries to get the meta data from WordPress based on the image name if the option “Get the caption from the database” is used.

    However – this also means, the image name in the HTML code has to be identical to the one in the database. So if you have an image named /media/mond-13Feb11.jpg this exact path has to be in the WordPress database as well, otherwise captions can not be read, because WordPress will not find anything when asking for metadata for the URL /media/mond-13Feb11.jpg.

    If you implemented some kind of rewriting (or use a plugin) to change all /wp-content/upload/... URLs to “nice” /media for the output, Lightbox with PhotoSwipe can not get the caption from the database any longer.

    If this will help, I could add a filter function for the next version which gets the image name from the HTML code and can provide the real image path name in the database if needed.

    Plugin Author Arno Welzel

    (@awelzel)

    In addition: a workaround is to put the captions to “Alternative text”, so they will be output as alt in the image.

    Thread Starter DocMario

    (@docmario)

    Hi Arno,
    thanks for the swift reply. Ages ago, when I first set up wordpress, I chose to change my default upload directory to /media… so it is really hard wired.
    In the meanwhile I played around a bit with different new plugins that I recently installed. I think, that the “autooptimize” plugin might interfere with your plugin.. I’m not sure yet.

    Plugin Author Arno Welzel

    (@awelzel)

    How did you change the uplaod directory? Did you overwrite the UPLOADS setting in wp-config.php? In this case I wonder why the meta data can not be retrieved. Maybe this is a bug in WordPress, but I have to spend more time to figure this out.

    Thread Starter DocMario

    (@docmario)

    yes, I changed the media path in wp-config.

    After tinkering around for a bit, I can still not deduce the logic behind those missing captions. even the “alt” texts are not displayed. the only caption that will show up is the figurecaption… so, i _could_ make a workaround by css display:none.. however, then I have to completely do without them on my pages.

    Well, thanks for now… I will gladly keep you updated, as soon as I find out more ??

    Plugin Author Arno Welzel

    (@awelzel)

    The “alt” texts are displayed, see these examples from your website:

    https://doktor-schubert.net/medizin/brustkrebstherapie-und-demenz/

    There is one image with the alt text “Breast Cancer Awareness” which is also used for the caption.

    https://doktor-schubert.net/medizin/miracle-mineral-supplement-mms/

    And here is an image which has “Pillen und Kapseln im Blister” as alt text which is also used. And there is also a description which got fetched from the database which also got used.

    Thread Starter DocMario

    (@docmario)

    Hmm, okay. Strangely, I checked the two examples that you gave me and saw no caption. then I followed an inspiration and logged out of my site account.. and lo and behold.. suddenly the captions were there!!!!
    So, i guess, there’s an incompatibility with some admin plugin or the admin taskbar.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Image caption empty’ is closed to new replies.