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.

7
  • 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
    Commented Oct 1, 2016 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
    Commented Oct 1, 2016 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. Commented Oct 7, 2016 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
    Commented Oct 8, 2016 at 6:06
  • 1
    My philosophy is that when you choose a CMS you go with it rather than creating extra work for yourself. Commented Oct 8, 2016 at 15:13

1 Answer 1

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
  • 1
    @ Rick Hellewell ... thankyou. Seems sensible.
    – glvr
    Commented Feb 7, 2017 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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