So I’ve spent a great deal of time looking for a solution to the layout issue with square galleries and circle galleries. Initially I also thought “why is the first image so dang large?”
I then realized that the rows of tiles want to try to match your $content_width. So I added this to my themes functions.php:
if ( ! isset( $content_width ) )
$content_width = 640; //pixel dimension. change to what you need
Everything seemed fine but… then I visited my site on a mobile device and the layout was messed up. It seemed like when my page rendered at smaller screen sizes, the image sizes weren’t calculated correctly. So I hit the forums looking for a solution. I finally gave up and came up with a quick n dirty fix with some jquery and css.
First, add this to your theme (this assumes your theme uses jquery – if it doesn’t jetpack likely adds it as most of its javascript depends on jquery). You can add before wp_footer() in your footer.php – or if you’re really cool, dump it in a separate javascript file and add it with wp_enqueue_script and use the ‘post_gallery’ hook to only add it to pages/posts that are using galleries.
<script>
jQuery(document).ready(function($) {
//jetpack tiled gallery fix
$('.tiled-gallery.type-square, .tiled-gallery.type-circle').each(function() {
var tilecount = $(this).children('.tiled-gallery-item').length;
if(tilecount % 3 === 1) {
$('.tiled-gallery-item:first-child',this).addClass('in-first-row');
} else if(tilecount % 3 === 2) {
$('.tiled-gallery-item:first-child, .tiled-gallery-item:nth-child(2)',this).addClass('both-first-row');
}
});
});
</script>
That will add some classes to square and circle galleries where the number of images is not divisible by 3. You can then add some really quick n dirty css to your theme’s style.css.
.type-square .tiled-gallery-item, .type-circle .tiled-gallery-item {
width: 33.3333% !important;
height:auto !important;
-moz-border-sizing:border-box;
box-sizing: border-box;
padding-right:4px;
}
.type-square .tiled-gallery-item img, .type-square .tiled-gallery-item.in-first-row, .type-square .tiled-gallery-item.in-first-row *, .type-circle .tiled-gallery-item img, .type-circle .tiled-gallery-item.in-first-row, .type-circle .tiled-gallery-item.in-first-row * {
width: 100% !important;
height:auto !important;
}
.tiled-gallery-item.both-first-row {
width:50% !important;
}
That was my “get it done now” solution but… the idea is sound if you want to improve upon it. You could, for instance replace jetpack’s stylesheets for square/circle galleries using wp_dequeue_style and that same hook, ‘post_gallery,’ and copy/edit those stylesheets to include with your theme (or in a plugin).
Lastly, if you aren’t a fan of the larger square or circle thumbnails and you absolutely want all images the same size, you could just add this to your stylesheet.
.type-square .tiled-gallery-item, .type-circle .tiled-gallery-item {
width: 33.3333% !important;
height:auto !important;
-moz-border-sizing:border-box;
box-sizing: border-box;
padding-right:4px;
}
.type-square .tiled-gallery-item img, .type-circle .tiled-gallery-item img {
width: 100% !important;
height:auto !important;
}
So… I hope that helps. Good luck. Also, this should probably be in the Jetpack forum.