Back to Community

Troubleshooting Common Advanced Gallery Caption and Lightbox Issues

Content

Users of the 'Gutenberg Blocks with AI by Kadence WP – Page Builder Features' plugin often turn to its powerful Advanced Gallery block. However, a recurring theme in community support involves challenges with image captions, particularly when using the built-in lightbox feature. This article consolidates the most common issues and their known solutions or workarounds, based on community discussions.

Common Caption and Lightbox Problems

1. HTML Links and Formatting Stripped in Lightbox Captions

The Problem: A frequent issue is that HTML code (like <a> tags for links or <br> tags for line breaks) added to a caption is displayed as plain text in the lightbox view, even if it appears correctly in the thumbnail gallery.

Why It Happens: The lightbox caption output is currently not designed to render HTML; it sanitizes the input and displays only plain text for security and consistency.

Known Status: The Kadence WP team has acknowledged this is a limitation of the current lightbox design. There is no built-in setting or simple workaround to enable HTML in lightbox captions. This has been noted as a potential candidate for a future update.

2. Caption Source and Management

The Problem: Many users want the gallery to pull captions directly from the WordPress media library's caption or description field. Instead, captions are managed independently within the gallery block. This leads to a cumbersome workflow where disabling captions on the front-end gallery also clears the data, forcing users to re-enter everything if they need to make a change later.

Why It Happens: The block uses its own data structure for captions to provide more layout and design control, which is separate from the core WordPress media metadata.

Known Status: The Kadence WP team has indicated that directly pulling from the media library's description field is not currently a feature but is something they are considering for the future.

3. Lightbox Captions Not Showing or Behaving Incorrectly

The Problem: Users have reported several bugs related to lightbox captions:

  • Captions disappearing entirely after a plugin update, despite being enabled in settings.
  • Captions not clearing between images. If one image has a caption and the next does not, the previous caption will persist.
  • Images with captions sometimes being duplicated in the lightbox carousel.

Why It Happens: These are typically bugs introduced in an update or edge cases in the JavaScript that controls the lightbox functionality.

Known Status: The development team has been responsive to these specific bug reports. For example, the issue of captions not clearing was flagged for an immediate fix. If you encounter these issues, ensure your plugin is updated to the latest version, as these bugs are often patched quickly after being reported.

4. Accessibility and Validation Concerns

The Problem: The HTML output of the gallery can sometimes fail W3C validation. Furthermore, for accessibility (WCAG compliance), the links generated by the gallery may lack proper aria-label attributes or title text that matches their visible captions.

Why It Happens: Validation errors can occur from complex block output. Accessibility features require specific implementation that may not have been the initial focus.

Known Status: The Kadence WP team has addressed specific validation errors, such as ensuring <figcaption> tags are used correctly. Improving aria-labels for accessibility is on their list for a future update.

Workarounds and Immediate Actions

While waiting for official fixes or features, here are actions you can take:

  1. Update the Plugin: Always ensure you are running the latest version of the plugin, as many caption-related bugs are fixed in subsequent updates.
  2. Basic CSS Styling: For visual issues like varying caption heights, you can use custom CSS to set a min-height on the caption container to create a uniform look.
  3. Test for Conflicts: If a feature like mobile font size for captions isn't working, test for a theme or plugin conflict by temporarily switching to a default theme (like Twenty Twenty-Four) and disabling other plugins.
  4. JavaScript Customization: For advanced users, some caption behaviors may be modified with custom JavaScript, though this requires significant technical skill.

For persistent issues that are not resolved by an update, the best course of action is to search for or create a detailed thread on the Kadence WP support forums, providing a clear description and a link to the page where the problem can be seen. This helps the development team investigate and prioritize fixes.

Related Support Threads Support