The best image/thumbnail plugin for WordPress is back with a brand new version and some nice changes.
I had been tinkering with this update for quite a while. There were few features that I could think of adding to this plugin. After years of development, it pretty much got the job done for most use cases. But, I managed to come up with some new things when working on some projects that utilized the script.
Note: If you’re on the latest version of Hybrid Core, it already has this version of Get the Image packaged with it.
The new plugin features
This isn’t actually a new feature. We’ve been using it in Hybrid Core for a couple of years, but it never got officially released in the plugin version. The new
srcset_sizes argument allows you to define an array of image size + descriptor pairs to define which image the browser should use.
Linking the image:
We’ve always been able to either link the image to the post or to not link to anything at all. The
link_to_post argument has been deprecated in favor of the new
link argument. It takes multiple value possibilities:
true– Links the image to the post.
'file'– Links to the image file itself.
'attachment'– Links to the image attachment page (if image is attachment).
false– No link.
link_class argument allows you to define a class for the link that wraps the image.
Classes from content width:
There are new image classes added based on the theme-defined
$content_width vs. the image width. Those classes are
Minimum width and height:
Sometimes, you need to show an image only if it meets a specific width and/or height in pixels. You can define the
min_height arguments to handle this. If the image doesn’t meet the minimum, it’s not shown.
Define image attributes:
img_attr argument allows theme authors to define the attributes for the
<img> tag output. It takes an array of attributes and their values.
Download version 1.1.0
You can update from your WordPress admin. If you’re not a current user, search for
get-the-image from the New Plugin screen.