Solution for messed up thumbnails
-
We have been experiencing a very hard update to NGG 2.0. One of the main issues was that the gallery thumbnails were messed up like this :
https://imageshack.us/a/img845/8971/v3p7.png
Even with 5 images per columns, there is one image which is “pushed” to next line (this happens with any number of images per columns, the last one is always on next line).The problem seems to be related to a conflict between the ngglegacy (which we use actually) and the css of the thumbnails.
In ngglegacy, the gallery thumnails are rendered in gallery.php. Each image is displayed with this type of line
<div id="ngg-image-<?php echo $image->pid ?>" class="ngg-gallery-thumbnail-box" <?php echo $image->style ?> >
The
<?php echo $image->style ?>
directive givesstyle="width:xx%";
with xx 100 dived by the amount of images per columns : so splitting up the space equally for each thumbnail picture. This worked nice with NGG 1.9.5.But if you look at the non-legacy code modules/nextgen_basic_gallery/static/thumbnails/nextgen_basic_thumbnails.css there something interesting.
.ngg-gallery-thumbnail-box { float: left; margin-right: 5px; }
On each thumbnail picture, a 5px margin is added. So you end with 100% + number of images * 5px with is larger than the page width and the last image goes under the line.
To solve this, just go to WP Admin Panel, Gallery > Other Options > Styles > (Show Customization Options) and add this to the file :
.ngg-gallery-thumbnail-box { margin-right: 0px; }
After this, everything should come back normally (i.e all pictures fits in their columns) like that : https://snag.fr/?p=509 or https://snag.fr/?p=389
Hope this can help anybody
- The topic ‘Solution for messed up thumbnails’ is closed to new replies.