0

I am using customize media_sideload_image just as provided in this post by @G.M.

Now I want to create different sizes of images other than which WP default uses.

Please provide suggestion

  • I am using like $image = media_sideload_image($url, $post_id); – Racheal Aug 23 '14 at 10:59
0

You can do something like this in your functions file.

    add_image_size( 'category-thumb', 300 ); // 300 pixels wide (and unlimited height)
    add_image_size( 'homepage-thumb', 220, 180, true ); // (cropped)

Then you can do something like this to give your custom size a certain name in the Admin area.

add_filter( 'image_size_names_choose', 'my_custom_sizes' );

function my_custom_sizes( $sizes ) {
    return array_merge( $sizes, array(
        'your-custom-size' => __( 'Your Custom Size Name' ),
    ) );
}

More info can be found here and here.

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.