3

How can I modify the size at which images in the media library are displayed when viewing the media library?

I use a function to disable generation/modification of images, and manually edit to 750x250px then upload.
When viewing the media library, I want them to display in this rectangular format (although smaller than actual) rather than the default square.

  • For that you can go to settings -> media. There add your required resolution either for Medium or for large and save changes. If you have change resolution for Medium option then On upload of image there is an option appear on right side to select size of image (thumbnail, medium, large etc). Choose medium and you will get your desire resolution. See if that helps. – Rishabh Oct 1 '16 at 9:33
  • @Rishabh... my understanding is that your suggestion won't be appropriate, because those settings are overridden by a function which stops WP processing uploaded images. – glvr Oct 1 '16 at 20:01
  • You'll need to be able to add your own styles and JavaScript to override the defaults. Be aware that disabling the built-in size of medium forces the media library to use the full size images and can cause performance problems for anyone viewing the admin screen. – Andy Macaulay-Brook Oct 7 '16 at 19:28
  • @Andy Macaulay-Brook... thanks. Good point about the sizes - I hadn't considered that... but as WP isn't generating any images, aren't full-size ones displayed? – glvr Oct 8 '16 at 6:06
  • 1
    My philosophy is that when you choose a CMS you go with it rather than creating extra work for yourself. – Andy Macaulay-Brook Oct 8 '16 at 15:13
1

A quick look at the media page with Firebug shows that this CSS statement will allow you to change the size of the picture:

.media-frame-content[data-columns="9"] .attachment {
width: 11.11%;

}

Change the 'width' value to something different, with the understanding that the change may affect how the page looks on different size screens.

You should put your modified CSS in the styles.css of a Child Theme, since any updates of WP or the theme (which might have their own media page) would cancel out your changes.

  • 1
    @ Rick Hellewell ... thankyou. Seems sensible. – glvr Feb 7 '17 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.