Image captions don't display in a line but just one word in a line

  • Author
    Posts
  • #71524

    When adding an image with description to a post (in Gutenberg) and aligning it left or right, setting medium size and a link to the media, the caption (text between <figcaption>text</figcaption>) renders on the final page in all browsers I’ve tested not in one line using the width of the entire image above but each word of the caption uses one separarte line.
    I’ve checked with all plugins disabled and the problem still exists. Switching to a default theme (Twenty Nineteen) fixes it.
    Some digging into it brought up .wp-block-image to be involved. I couldn’t find it within the theme but somehow it gets overwritten modified… something added, I don’t know.
    If I change wordpress core styles, I get it going somehow.

    Replacing withoin /wp-includes/css/dist/block-libraray/style.min.css

    
    .wp-block-image .aligncenter>figcaption,.wp-block-image .alignleft>figcaption,.wp-block-image .alignright>figcaption,.wp-block-image.is-resized>figcaption{display:table-caption;caption-side:bottom}
    

    to

    
    .wp-block-image .aligncenter>figcaption,.wp-block-image .alignleft>figcaption,.wp-block-image .alignright>figcaption,.wp-block-image.is-resized>figcaption{display:table-caption;caption-side:bottom;width:100%}
    

    That fixed the problem for me if I add text next to the image. If however no text gets added next to the image, the caption spans over the entire site width and not only the image size.

    Maybe someone has a solution as it’s not good practice to mod core files.

    Thanks,
    Thomas

    #71538

    Zed
    Cryout Creations Team

    This is due to a styling incompatibility introduced with WordPress’ 5.0 Gutenberg blocks which we’ll correct in the next theme update.


    If you like our creations, help us share by rating them on WordPress.org.
    Please read the available documentation and search the forums before posting.
    #71547

    Thanks for the info. That’s good news.

    Best regards,
    Thomas

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

The topic ‘Image captions don't display in a line but just one word in a line’ is closed to new replies.