Support » Plugins and Hacks » New Plugin: Custom Image Sizes

  • I’ve created a new WordPress plugin, Custom Image Sizes.

    With default WordPress, if you call something like

    echo wp_get_attachment_image( 123, 'my-custom-size' );

    and ‘my-custom-size’ doesn’t exist for attachment 123, WordPress just scales down the existing image.

    Activate my plugin and instead WordPress will create the correct size on demand, if it doesn’t already exist.

    Also, you can specify image dimensions directly, like so:

    echo wp_get_attachment_image( 123, '360x180' );

    where 360 is the desired width in pixels, and 180, the height in pixels.

    It’s been helpful to me, so I hope it might be useful to others.

  • The topic ‘New Plugin: Custom Image Sizes’ is closed to new replies.