• Resolved bradhar

    (@bradhar)


    Hello people, I really like this lightbox and want to use it, but I need captions. I have the latest version installed and see the new caption code in the js file but it’s not working for me.

    I read that the caption is pulled from the image’s alt attribute. When an image pops up in the lightbox, in the inspector I can see the img’s alt is blank: just ‘alt=””‘ so it can’t pull the caption. Has anyone else experienced this?

    https://ww.wp.xz.cn/plugins/wp-featherlight/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Robert Neu

    (@fatmedia)

    Hey Bradhar,

    The reason you’re running into that issue is that the plugin doesn’t use alt tags for captions. It uses the WordPress caption system, which should be a more reliable way for captions to be displayed only when you want them.

    Here’s some information on how the WordPress caption system works. If you add some captions to your images, you should see that they appear in the lightbox as well.

    Thread Starter bradhar

    (@bradhar)

    Thanks for the quick response, Robert. That wasn’t it. I had text in the caption and description fields ready to go as well. I had just read about the alt text somewhere and thought that may have something to do with it.

    I found WP Featherlight and this plugin don’t play nice together:

    Cleaner Gallery
    Version 1.1.0 | By Justin Tadlock
    Replaces the default [gallery] shortcode with valid HTML5 markup and moves its inline styles to a proper stylesheet. Integrates with many Lightbox-type image scripts.

    I need it because it fixes another issue I was having with the WordPress gallery. I wish I knew how to make everything cooperate. This other lightbox that works doesn’t function nearly as well on mobile.

    Plugin Author Robert Neu

    (@fatmedia)

    Bradhar,

    Ah, there have been a few other users who have run into this. That plugin isn’t really necessary anymore now that WordPress has built HTML5 support into the galleries. As far as I know, it’s been semi-deprecated by Justin.

    If you disable it and add the following to your theme’s functions.php file, you should have the HTML5 galleries you’re after and the lightbox will work properly with them:

    add_theme_support( 'html5', array( 'gallery', 'caption' ) );

    The reason cleaner gallery doesn’t work is it uses a different class for the captions than WordPress core does. On the one hand, we could add support for it, on the other it’s adding extra JS to our plugin to support something that isn’t really necessary anymore so at this point I’ve elected not to do it.

    I hope that helps!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Captions not apprearing’ is closed to new replies.