Title: Preventing duplicate image captions/title
Last modified: August 30, 2016

---

# Preventing duplicate image captions/title

 *  [AndyLangton](https://wordpress.org/support/users/andylangton/)
 * (@andylangton)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/preventing-duplicate-image-captionstitle/)
 * A previous post described a similar issue to the one that I’m having:
 * [https://wordpress.org/support/topic/plugin-wp-jquery-lightbox-caption-showing-up-twice](https://wordpress.org/support/topic/plugin-wp-jquery-lightbox-caption-showing-up-twice)
 * If I add an image gallery to a post the following is displayed when clicking 
   to enlarge an image:
 * Image
    Bold text Normal test
    - If an image only has a caption, the caption is displayed in bold.
    - If an image only has a title, the title is displayed in bold.
    - If an image has both a title and a caption, the caption is displayed twice,
      in bold text and normal text. The title is no longer displayed.
 * Captions display correctly for images that are not enlarged.
 * I’m wondering where I should be looking to troubleshoot this problem. It occurs
   in all themes that I’ve tried.
 * Thanks for any help.
 * [https://wordpress.org/plugins/wp-jquery-lightbox/](https://wordpress.org/plugins/wp-jquery-lightbox/)
 * Edit: after more testing the behaviour is slightly stranger than that:
 * For a set of image, each of which have a title and caption. When enlarging:
    - The first image only displays the title
    - The second image repeats the caption for both title and caption
    - The remaining images only show the caption
 * I wonder if this is related to the `getCaption` function and use of `parent().
   next('.gallery-caption');`?

Viewing 1 replies (of 1 total)

 *  [ulfben](https://wordpress.org/support/users/ulfben/)
 * (@ulfben)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/preventing-duplicate-image-captionstitle/#post-6762086)
 * [From the FAQ](https://wordpress.org/plugins/wp-jquery-lightbox/faq/):
 * > WP jQuery Lightbox grabs texts from four different HTML nodes;
    1. title-attribute of link-to-image
    2. img tag’s title attribute (if 1 is empty)
    3. img tag’s alt attribute (if 1 and 2 is empty)
    4. HTML content of .gallery-caption or .wp-caption-text (in that order)
 * Look at how the default TwentyTwelve theme uses these in its galleries and set
   up your theme so it outputs what you need in these places.
 * If the problem persist even when running TwentyTwelve, give us a link to a gallery
   where the problem can be seen.

Viewing 1 replies (of 1 total)

The topic ‘Preventing duplicate image captions/title’ is closed to new replies.

 * ![](https://ps.w.org/wp-jquery-lightbox/assets/icon-256x256.png?rev=3274178)
 * [LightPress Lightbox](https://wordpress.org/plugins/wp-jquery-lightbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-jquery-lightbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-jquery-lightbox/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-jquery-lightbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-jquery-lightbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-jquery-lightbox/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [ulfben](https://wordpress.org/support/users/ulfben/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/preventing-duplicate-image-captionstitle/#post-6762086)
 * Status: not resolved