Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Is it possible to change the image size of the thumbnails in the new media uploader?

For example images are currently displayed using the "thumbnail" image crop size and I would like them to be the "medium" image crop size.

share|improve this question
1  
Just to clarify...are you talking about changing the display of the Media stuff on the backend or images being used in the content somewhere? – JCL1178 Jan 15 at 18:30
For within the new Media Uploader only. – mattrepublic Jan 15 at 18:36

1 Answer

Supposing that I'm interpreting your Question correctly...

The thumbnails displayed in the new Media Uploader are already the medium sized ones, being constrained on the fly.

media uploader inspector

So, it's a matter of applying some CSS styling to increase their size. Maybe other style adjustments are necessary, this is just a proof of concept.

add_action( 'admin_head-post-new.php', 'style_thumbnails_wpse_81677' );
add_action( 'admin_head-post.php', 'style_thumbnails_wpse_81677' );

function style_thumbnails_wpse_81677()
{
    $thumb_width  = get_option( 'medium_size_w' );
    $thumb_height = get_option( 'medium_size_h' );

    echo "
    <style type='text/css'>
        .details.attachment, .attachement, .attachment.save-ready {
            width:{$thumb_width}px !important;
        }
        .attachment-preview, .attachment-preview .thumbnail {
            width: {$thumb_width}px !important;
            height: {$thumb_height}px !important;
        }
        .portrait .thumbnail img, .landscape .thumbnail img {
            max-width: {$thumb_width}px !important;
            max-height: {$thumb_height}px !important;
        }
    </style>
    ";
}

Result:

bigger thumbs in new media uploader

share|improve this answer
how do you enable the "attachment display settings", they don't appear on my site – paul Feb 20 at 12:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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