Title: Random justified gallery problem
Last modified: May 31, 2017

---

# Random justified gallery problem

 *  Resolved [AdiRMG](https://wordpress.org/support/users/adirmg/)
 * (@adirmg)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/)
 * Hello.
 * I have a problem when i select random justified gallery. The thumbnails are random
   sizes but they are not justified.
 * You cand see here better: [http://www.raduadrian.ro/scf-black-sea-tall-ships-regatta-2014/](http://www.raduadrian.ro/scf-black-sea-tall-ships-regatta-2014/)
 * If i click on a thumbnail to load the lightbox and then close the lightbox, the
   thumbnails become justified like they are supposed to.
 * Is there any fix for this?

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

 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9183722)
 * I am not able to replicate this on your site – it shows up as justified right
   from the start. Is there a specific browser where this is happening?
 *  Thread Starter [AdiRMG](https://wordpress.org/support/users/adirmg/)
 * (@adirmg)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9184800)
 * Hello. It is happening on Safari 10.0.3, Firefox 53.0.3 and Chrome 58.0.3029.110,
   all running on MacOS 10.12.3 in 64bit.
 * My screen resolution is 2560×1440 (27″ display).
 * Here is a screenshot from Chrome, but it looks the same on all the browsers i
   mentioned.
 * ![](https://i0.wp.com/s29.postimg.org/o4pjn0td3/Screen_Shot_2017-05-31_at_22.51.04.
   png?ssl=1)
 * This happens on all the pages, not just here, but i set the rest to masonry layout.
    -  This reply was modified 8 years, 11 months ago by [AdiRMG](https://wordpress.org/support/users/adirmg/).
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9187378)
 * I tried FF, IE and Chrome on a Windows machine, and this rendered fine on all
   of them. I am on a smaller laptop screen at present – I can try a larger screen
   when I am at home during the weekend.
 *  [nimbus2006](https://wordpress.org/support/users/nimbus2006/)
 * (@nimbus2006)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9203077)
 * Hi, I have the same problem on my site but would fit them all once rerendering.
   
   Any good solution without rendering?
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9203221)
 * [@nimbus2006](https://wordpress.org/support/users/nimbus2006/),
    Please start
   your own thread and provide a URL. Without a URL I cannot help troubleshoot this.
 *  Thread Starter [AdiRMG](https://wordpress.org/support/users/adirmg/)
 * (@adirmg)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9206880)
 * I think it has something to do with the resolution. Because if i set my display
   resolution to something smaller than 2560×1440, like 1600×900, everything is 
   fine.
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9206921)
 * That’s an interesting observation. I know that I have no checks based on resolution
   in the plugin, but do you have some sort of responsive settings in your theme,
   that get triggered at higher resolutions?
 *  Thread Starter [AdiRMG](https://wordpress.org/support/users/adirmg/)
 * (@adirmg)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9208128)
 * The theme is responsive.
 * When the width gets below a certain size it changes a bit, but on the high resolution
   that i mentioned before (2560×1440) it does not matter what size the browser 
   window has, the issue is there.
 * I saw that if i resize the browser window after the page has loaded (with the
   messed up layout) the thumbnails become justified. So only the first render of
   the gallery is not justified, if i resize the browser window it gets justified.
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9209155)
 * OK – do you have a child theme? If so, this is what you can add in the `footer.
   php` file of your child theme:
 *     ```
       <script type='text/javascript'>
       jQuery(window).load(function() {
       	photonicJustifiedGridLayout(true);
       });
       </script>
       ```
   
 * This will force the Justified Grid to be called after the page loads (simulating
   a resize).
 * Even if you don’t have a child theme you can do this in your parent theme, but
   you will have to redo it whenever your theme gets updated.
 *  Thread Starter [AdiRMG](https://wordpress.org/support/users/adirmg/)
 * (@adirmg)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9210671)
 * Perfect, thank you!
 * One more question (more like a feature request), is there a posibility to specify
   a maximum width for the thumbnails in justified layout?
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9211103)
 * Well, that is not algorithmically possible for this layout. The justified grid
   layout is _height constrained_ not width constrained, because at the end of the
   day all images in a row have to be of the same height. Putting a constraint on
   the width makes it impossible to balance the justified nature of the layout with
   heights. The only way to offer this capability is to not require the last row
   to be perfectly aligned, and I am not very fond of the resulting layout.
 * The masonry layout is width constrained and that is something you can consider
   using.
 *  Thread Starter [AdiRMG](https://wordpress.org/support/users/adirmg/)
 * (@adirmg)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9212670)
 * That’s right. I ment height.
 * How can i set the maximum thumbnail height for justified layout?
 *  Plugin Author [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * (@sayontan)
 * [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9214304)
 * There is a setting for the minimum height, to ensure that you are not getting
   tiny thumbnails. You cannot set a maximum height. The minimum height setting 
   is here: _Photonic → Settings → Generic Options → Layouts → Random Justified 
   Gallery – Minimum Tile height_

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

The topic ‘Random justified gallery problem’ is closed to new replies.

 * ![](https://ps.w.org/photonic/assets/icon.svg?rev=1972449)
 * [Photonic Gallery & Lightbox for Flickr, SmugMug & Others](https://wordpress.org/plugins/photonic/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/photonic/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/photonic/)
 * [Active Topics](https://wordpress.org/support/plugin/photonic/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/photonic/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/photonic/reviews/)

 * 13 replies
 * 3 participants
 * Last reply from: [Sayontan Sinha](https://wordpress.org/support/users/sayontan/)
 * Last activity: [8 years, 11 months ago](https://wordpress.org/support/topic/random-justified-gallery-problem/#post-9214304)
 * Status: resolved