• I’m trying to do new galleries in WordPress 5, but I have two problems.

    On this page, the last image happens to be alone in its row, making it fill the whole width. I would like it to be the same size as the other thumbnails. How do I do that? I have other galleries on my site that were created in earlier versions, and they look correct.
    [ redundant link removed ]

    Also, the thumbnails are not square, but vary in size from row to row. How do I get them all to be the same size?

    Thanks,

    /Mattis

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • How content is displayed is controlled by the theme. Thumbnail sizes are defined in the theme’s functions file.
    Theme support is found here: https://wordpress.org/support/theme/hueman

    You can control the image size through CSS also. If you set a max-width that will not happen.

    You would probably have to look at each media query and adust the max size like this code.

    @media (min-width: 600px)
    .wp-block-gallery.columns-4 .blocks-gallery-image, .wp-block-gallery.columns-4 .blocks-gallery-item {
        width: calc((100% - 16px * 3)/ 4);
        margin-right: 16px;
        max-width: 23%;
        height:auto;
    }

    if you are going to adjust the thumbnail size in functions.php you might want to add the plugin regenerate thumbnails and let it regenerate all your thumbnails. https://wordpress.org/plugins/regenerate-thumbnails/

    • This reply was modified 7 years, 4 months ago by mrtom414.
    Thread Starter mattisgbg

    (@mattisgbg)

    I probably should have provided this from the start, but this is a link to a gallery that I created earlier, that looks exactly like I want it to. But the new galleries that I create do not look the same.

    https://mattis.se/2017/01/22/bilder-fran-taiwan/

    The last image is also alone, but is still the same size as the other thumbnails.

    I had a look at the html in the editor, but the new syntax is very different from the old one.

    I also noticed just now that whichever image I click on in the gallery it’s always the first one that opens.

    • This reply was modified 7 years, 4 months ago by mattisgbg.
    • This reply was modified 7 years, 4 months ago by mattisgbg.

    the max-width will keep it from expending all the way across the page. since there are 4 images on the level when it above 600px you will need to keep the li items to below 1/4 the size of the overall length. if there where 3 images across you would have to make it less then 1/3 and so on. I set the max width to 23% because there is a margin added to the image to form the gap between images.

    if you adjust each of the media queries by adding the max-width: you should be close. You should be able to add something to customize additional CSS.

    @media (min-width: 600px){
    .wp-block-gallery.columns-4 .blocks-gallery-image, .wp-block-gallery.columns-4 .blocks-gallery-item {
        max-width: 23%;
        height:auto;
    }
    }
    Thread Starter mattisgbg

    (@mattisgbg)

    So the gallery in WordPress 5 requires other CSS definitions than the gallery in earlier versions?

    Thread Starter mattisgbg

    (@mattisgbg)

    I changed into using the classic editor instead of the new one in WordPress 5, and now I can create galleries that look just the way I want them to.

    The galleries in WordPress 5 blocks obviously uses different formatting than the classic ones.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Gallery thumbnails too large’ is closed to new replies.