• Sandra

    (@sandracwalsh)


    Hello –

    I am using the standard [gallery link="file"] tag

    At
    https://nelsonconstruction.ca/index.php/projects/

    .. the gallery for the first post has a large gap between the first and second row of images. This is the same for all single posts.

    I have checked the source and the galleries are all coded within the same div tags.

    I would be grateful for any suggestions.

    thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Unfortunately, it’s a bug in the gallery shortcode output. Apart from the fact that it place CSS in the body of the page (which drives me up the wall), after the specified number of columns/images (in your case, 3), it issues a <br style="clear: both;"/>. Which is a bit of a b*gger when you have a left floated sidebar/menu!

    Currently, the only really workable option that I know is to re-write the gallery shortcode within functions.php. ??

    Any changes to the shortcode you make will be overwritten when you upgrade. This is because the code doesn’t sit in your functions.php file but within the media directory.

    After being frustrated by this issue I started doing some research and found that the issue is being caused (as was correctly stated above) by the <br style=”clear: both;”/> in certain themes that use CSS to float the columns.

    One suggestion that was made was to insert the following piece of code into your style.css file

    .gallery br {display:none;}

    It was also pointed out that this method was brute-force but it definitely solved the problem I was having with the gallery.

    FYI – The source article is here

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘gallery on first post has large space between image rows’ is closed to new replies.