RICG-Responsive-Images Plugin

January 19, 2015 - Tim Evko

For the last few months, several members of the WordPress core team, Mat Marquis of the RICG, and I have been hard at work building a WordPress plugin. While this may not initially sound like very exciting news, the purpose of the plugin is to bring responsive images to the WordPress platform, with absolutely no effort needed by the user. And we think that’s pretty exciting. The plugin can be found here and you can contribute on Github here.

We all have some pretty big plans for this plugin, which means that we will continue to maintain and add features as needed. While the plugin can be viewed and installed by everyone, please consider it to be in beta for the time being. That being said, we would love to hear your feedback, so please feel free to use the Github repo for all questions, comments, and concerns.

How It Works

After installing the plugin and adding an image through the WordPress media uploader, a srcset attribute will be included in the html whenever that image is dropped into a post. This process is designed to be backwards compatible, meaning that it will work for new and old images alike. The same happens for featured images as well, meaning that <?php the_post_thumbnail(); ?> will also return a responsive image!

If you’re a theme developer, you can output a responsive image anywhere you’d like by using the following syntax:


<img src="pathToImage" <?php echo tevkori_get_src_sizes( TheIdOfYourImage, theLargestImageSizeNeeded ); ?> />

e.g)


<img src="myimg.png" <?php echo tevkori_get_src_sizes( 11, 'tevkoriMedium-img' ); ?> />

This plugin is a fork of wp-tevko-responsive-images, which is now deprecated, so please be sure to update!