Wrapping images in tags based on size

You can wrap specific sizes in arbitrary html when they’re inserted into post content via the image_send_to_editor filter. Here we check if $size is thumbnail and wrap it in a div, otherwise we just return the unaltered $html: function wpd_wrap_thumbnails( $html, $id, $caption, $title, $align, $url, $size, $alt ){ if( ‘thumbnail’ == $size ){ return … Read more