New Plugin: Custom Image Sizes (1 post)

  1. Austin Matzko
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic