• Resolved biggies

    (@biggies)


    Hello,

    I just used Photoswipe. It looks really nice on website, but I got problem with captions. Some photos got captions others not. And don’t know why. Where should I add caption to see it right ?

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

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

    (@awelzel)

    Captions are take from several sources:

    1. If enabled in the backend options (Get the image captions from the database): from the “Caption” field in the media library

    2. If provided by the gallery frontend one of the following elements in the HTML code. Whatever provides the caption first will be used:

    The text element referred by the aria-describedby attribute in the image link.

    The first figcaption element inside the image link element.

    Any following element after the image link element if it has the class wp-caption-text or gallery-caption or if it is a figcaption element.

    The title attribute of the image link.

    (Yes, finding the image caption is not easy in the frontend ;-)).

    So the most reliable way should be to add the caption to the “Caption” field in the media library and enable the option “Get the image captions from the database”. If this slows down the website too much for you (usually this is only a problem on really slow servers), you can also disable that and let the frontend script try to figure out the caption. Since it works for at least some of your pictures I think you just did not add the caption to the “Caption” field but to “Description”.

    Thread Starter biggies

    (@biggies)

    I was looking for captions in Media Library and everything is same like in photos. I just don’t understand why it’s not in every photo. Because gallery takes captions from Media library. Watch screenshots please for better explanantion. Description is empty.

    View post on imgur.com

    View post on imgur.com

    • This reply was modified 5 years, 4 months ago by biggies.
    Plugin Author Arno Welzel

    (@awelzel)

    I don’t see any caption in the gallery at all.

    It seems, captions are added as alt attribute to the image. But there is no visible caption at all. And usally the alt attribute is not the caption but the “Alternative text” in the media library.

    It seems, I need to use that attribute as well if nothing else works.

    Edit: did you enable “Get the image captions from the database” in the backend options?

    • This reply was modified 5 years, 4 months ago by Arno Welzel.
    Thread Starter biggies

    (@biggies)

    If you look on that images you will see that I fill both images in backend in the same way, but in front-end is just one shown properly.

    Where I can find “Get the image captions from the database” please ?

    Plugin Author Arno Welzel

    (@awelzel)

    This setting is in Settings -> Lightbox with Photoswipe and there in the group “Other options”.

    Thread Starter biggies

    (@biggies)

    Got it. And it’s checked

    Plugin Author Arno Welzel

    (@awelzel)

    It seems you use some plugin which changes the way how media is handled in WordPress, so Lightbox with Photoswipe can’t get the image meta data based on the image URL.

    I’ll add an option to use the alt attribute as an additional source for captions in the next update.

    Thread Starter biggies

    (@biggies)

    It sounds good. I’ll be waiting for next update. Thank you

    Plugin Author Arno Welzel

    (@awelzel)

    The latest update to version 2.4 contains a new option in the backend settings to use the alternative text of images as caption. When you enable this, you should have caption in all your images.

    Thread Starter biggies

    (@biggies)

    I checked it and it doesn’t work. It’s really interesting. I think I will need to look closer on my settings in web, because there must be something bad

    Plugin Author Arno Welzel

    (@awelzel)

    I think, “Lazy Load XT 1.1.0” causes a number of problems here. See the JavaScript console of your browser – there are a lot of error messages when loading the page and they all come from “Lazy Load XT 1.1.0”. Maybe you should temporary disable this Add On – just to see, if things work better then.

    Thread Starter biggies

    (@biggies)

    Deactivated lazy loading and loading page as well and nothing happens. Still is there problem with captions

    Plugin Author Arno Welzel

    (@awelzel)

    It looks like you did not enable the option for alternative image text as caption. In the source of your website I see:

    <script type="text/javascript">var lbwps_options = { ... "use_alt":"0" ...

    So please check the backend settings for Lightbox with Photoswipe that the option “Use alternative text of images as captions if needed” is checked.

    But I already told that yesterday:

    The latest update to version 2.4 contains a new option in the backend settings to use the alternative text of images as caption. When you enable this, you should have caption in all your images.

    • This reply was modified 5 years, 4 months ago by Arno Welzel. Reason: typo
    Thread Starter biggies

    (@biggies)

    Ye I deactivated it when it didn’t work. But now you can look. And still nothing

    Plugin Author Arno Welzel

    (@awelzel)

    No – it works now.

    Picture 1: “Ethopia air”

    Picture 2: “Holy Trinity Cathedral in Addis Ababa. It was built to commemorate Ethiopia’s liberation from Italian occupation.”

    Picture 3: “Holy Trinity Cathedral”

    Picture 4: “Rock-Hewn Church, Lalibela”

    And so on. Please reload the page or clear your browser cache to see the change.

    Edit: Yes, some pictures still don’t have a caption – but this is because there is no caption at all, also no alternative text.

    • This reply was modified 5 years, 4 months ago by Arno Welzel.
Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘No caption in some photos’ is closed to new replies.