[Resolved] How to get image caption in gallery below the image

Home Forums Support [Resolved] How to get image caption in gallery below the image

Home Forums Support How to get image caption in gallery below the image

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1608138
    Milan

    Hello GP team,

    i am trying to get image caption (in gallery) below the image in the same manner as single images captions are.

    I tried edit some code from forum but nothing works.

    Thank you for your help.
    Milan

    #1608234
    David
    Staff
    Customer Support

    Hi there,

    can you share a link to where i can see the issue ?

    #1608260
    Milan

    Hi David, for example – https://jizda-zazitkova.cz/jizda-v-dodge-challenger . When I reduce screen size the caption of images in gallery is to big. I would like to get image caption (in gallery) below these images. If is it possible ๐Ÿ™‚

    #1608616
    Leo
    Staff
    Customer Support

    Typically this should be a question for WordPress support team as the gallery block and the CSS is all handled by WP itself.

    However, you can try something like this:

    .blocks-gallery-grid .blocks-gallery-image figcaption, .blocks-gallery-grid .blocks-gallery-item figcaption, .wp-block-gallery .blocks-gallery-image figcaption, .wp-block-gallery .blocks-gallery-item figcaption {
        position: unset;
    }
    .blocks-gallery-grid .blocks-gallery-image figure, .blocks-gallery-grid .blocks-gallery-item figure, .wp-block-gallery .blocks-gallery-image figure, .wp-block-gallery .blocks-gallery-item figure {
        flex-direction: column;
    }

    Adding CSS: https://docs.generatepress.com/article/adding-css/

    #1608912
    Milan

    Thank you Leo. It works but images in the gallery that do not have the same height are not align to the same height. You can see this issue for example – https://jizda-zazitkova.cz/jizda-na-ducati/ (bottom gallery). Do you have any ideas?

    #1609131
    David
    Staff
    Customer Support

    Hi there,

    there isn’t a simple automated method to resize images to fill the same height of a gallery row. The simplest fix is to crop your original images so they all have the same aspect ratio.

    #1609147
    Milan

    Ok, thank you for your time guys! ๐Ÿ™‚

    #1609203
    David
    Staff
    Customer Support

    Glad we could be of help

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.