views:

78

answers:

2

Hey.. quite embarrassed to ask this actually - I should be able to find this on Google, but because of all the new WP functionality as well as the older methods of doing this in older versions are riddled all over Google Results that I have resorted to leverage the knowledge of a good samaritan out there somewhere.

I already know how to set up custom thumbnail sizes (I'm developing a Magazine style theme), and at the moment I'm working on getting my gallery working. When I choose to "insert to post" an image, it gives me 4 options - small, medium and large thumbnails plus the original size.

I need to know, for embedding purposes (not the featured post thumbnails), how to set the default sizes of these thumbnails so that they appear in the Media section of the Post editing screen.

Any ideas?

A: 

Look in your wordpress root folder as such:

wordpress_root\wp-includes

In this folder there is a file called: media.php

Starting on Line 34 there is a function:

function image_constrain_size_for_editor($width, $height, $size = 'medium')

in this function, starting on Line 41, there is the following code. Just edit this for your needs:

elseif ( $size == 'thumb' || $size == 'thumbnail' ) {
        $max_width = intval(get_option('thumbnail_size_w'));
        $max_height = intval(get_option('thumbnail_size_h'));
        // last chance thumbnail size defaults
        if ( !$max_width && !$max_height ) {
            $max_width = 128;
            $max_height = 96;
        }
    }
Todd Moses
There's always a method to do this without having to edit anything outside the template folder or the database...
jeffkee
Actually. Looking at your code gave me the epiphany. get_option pulls out data from the Wordpress settings table. So I looked around in the Admin screen... if you go to Settings->Media, the size settings are all there. Since an earlier version of WP.. My god I feel stupid I didn't think of that simple option!
jeffkee
A: 

I answered my own question folks, and I feel quite dumb.. haha.

It was in the Admin screen. Left bar.. Settings -> Media, and there they are. Thumbnail, medium, and large sizes. No file hacks, no custom size settings in the functions.php file necessary.

Oops!

jeffkee