Use the picture element for responsive images in wordpress
just upload the plugin and install it. It'll take of the rest
use the filter kanedo_responsive_image_scales
to add or remove scales.
e.g.
function custom_scales( $scales ){
return array(2,3,4);
}
add_filter( 'kanedo_responsive_image_scales', 'custom_scales');
to generate thumbnails for 1x
, 2x
, 3x
and 4x
. Default is 1x
, 2x
, 3x
the plugin replaces the img tags and adds the attr srcset
the plugin provides a shortcode responsive_image
which has 4 attributes:
'id' => 1, // the attachment id
'size' => 'full', // the image size
'alt' => '', // the alt text
'align' => 'none' // the alignment
use it like this:
[responsive_image id='490' size='thumbnail' alt='test' align='none']
it'll be inserted when using the wordpress media picker
- fix JS Asset Path
- initial release