Support » Fixing WordPress » insert image size choose

  • I want to insert image from media library to post.
    In older version, i could just select any pic and set its size to one from predefined list (large / small / custom-size-1 / custom-size-2).

    In version 3.5 i cant find anywhere this option. While choosing an image i can choose from select list – only one option – full size.

    I tried this:

    function my_insert_custom_image_sizes( $sizes ) {
        // get the custom image sizes
        global $_wp_additional_image_sizes;
        // if there are none, just return the built-in sizes
        if ( empty( $_wp_additional_image_sizes ) )
            return $sizes;
        // add all the custom sizes to the built-in sizes
        foreach ( $_wp_additional_image_sizes as $id => $data ) {
            // take the size ID (e.g., 'my-name'), replace hyphens with spaces,
            // and capitalise the first letter of each word
            if ( !isset($sizes[$id]) )
                $sizes[$id] = ucfirst( str_replace( '-', ' ', $id ) );
        return $sizes;
    function custom_image_setup () {
        add_theme_support( 'post-thumbnails' );
        add_image_size( 'custom-image-size-1', 160, 9999 ); //  small columned
        add_image_size( 'custom-image-size-2', 300, 9999 ); //  medium
        add_image_size( 'custom-image-size-3', 578, 190, true ); //  cropped
        add_filter( 'image_size_names_choose', 'my_insert_custom_image_sizes' );
    add_action( 'after_setup_theme', 'custom_image_setup' );

    But it dont work.

    How to set a size to image in post?

Viewing 15 replies - 1 through 15 (of 16 total)
  • Insert the media into your post or page.
    Then select the media and in the upper left corner will you get a
    small image icon. Select it and then you can scale down your image based on percentage.

    But i want to choose one from predefined like before,
    So i want to have a list of options that i can choose between

    (large / small / custom-size-1 / custom-size-2).

    Your solution will work but its not nice to user, and every single post will have various sizes.

    When I look at my “Attachment Display Settings” on the very lower right hand side, when I go to insert my media I get – Full size, Medium, and thumbnail

    Hmm thats the problem.

    I have tried my php code in other WP site, and that works – i can choose all the options.

    My problem now is not adding new sizes but display these sizes in menu. I dont know why this menu shows only one position – full width, when the same theme on another server works fine :/

    Where and how I have to search this displaying bug – list of sizes?

    Moderator bcworkz


    A curious problem indeed. I’ve no idea what the problem may be. In such situations, it may be worth trying temporarily deactivating all the plugins. If the problem goes away, reactivate each plugin in turn until you find the one causing the problem to reappear.

    If the problem remains with plugins deactivated, reactivate them all and be glad you don’t have find bugs in plugins.

    So im glad i dont have to find bugs in plugins 😛

    Any other ideas?

    Hmm, on my localhost using WAMP server, I have installed latest WordPress, I can add media with all the various sizes from list. When i have installed the same wordpress on the web server, I can choose only full width, on twentytwelve theme. Tried it just after install wordpress. So i guess it’s my server problem.

    GD support is enabled. Whats going on?!

    Did you check your “Media Settings” inside of “Settings”/”Media”

    Specifically look at you Images Sizes information.
    The sizes listed below determine the maximum dimensions in pixels to use when inserting an image into the body of a post.

    Hey folks,

    Just to report. I have the same problem, and with all plugins deactivated. Trying to check on this now. Never seen this before.

    Ok, something happened now. I’m not really sure what I did that made this work.

    I deleted cash, and with all plugins deactivated, I switched to Twentyeleven WP default theme. I went to a page and tried to add an image to it. The size selector was now there.

    I then switched back to my WooThemes theme, and it works now. Trying to reactivate one plugin at a time.

    I’ve found a plugin Simple Image Sizes, it works it’s magic via UI without the need to do any manual coding.

    It also includes thumbnail regeneration link, which is needed for any new size creations.

    Hope this helps.

    Hey Makbeta,

    Will look into this and check it out. I fixed it, but a better plugin for this would be nice.


    Having the same problem now, any updates on this? Simple image sizes doesn’t change anything.

    Now I am trying to figure out if I have a problem with GD support. Someone else installed this wordpress installation on a subdomain.

    After 2 months i have still a problem with image editor and image sizes, but – i have found that it dont work only for jpgs. If i upload gif it works fine, i can crop images, and choose image sizes, so the problem in my case is with a hosting service, not with wordpress actually.

    I am waiting for response from hosting administrator, i hope he will say me what was wrong and ill write it here 🙂

    I think I found that there is no GD graphics library on our hosted server. I will try to remember to let everyone know if it fixes the problem.

    Bazan, I don’t know what is wrong with your image sizes. If it works on wamp, and not on your server, there has to be something wrong with the hosting or maybe permissions? Wish I could help more.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘insert image size choose’ is closed to new replies.