• A previous post described a similar issue to the one that I’m having:

    https://ww.wp.xz.cn/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://ww.wp.xz.cn/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)
  • From the 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.